CodeYourFuture / syllabus

Old Syllabus Website for CodeYourFuture
https://syllabus.codeyourfuture.io
153 stars 124 forks source link

Investigate GitHub Codespaces #441

Open illicitonion opened 2 years ago

illicitonion commented 2 years ago

What is the work that needs to be done?

Currently we have two problems:

  1. Several trainees run on machines which are low-spec enough that doing things like creating a new react app can take 5-10 minutes
  2. We spend a lot of time helping people wrangle machine configs, getting out of weird set-ups, etc. (Particularly on Windows)

GitHub Codespaces should theoretically help make this problem go away by using consistent cloud environments for development.

We should investigate whether GitHub Codespaces can help us with this! Probably this looks like playing around with the infra to see how well it works for our first few modules of exercises, and writing up some reproducible instructions.

SallyMcGrath commented 1 year ago

@alastair87 I've "assigned" you to this issue based on the fact that you are actually already doing it. Record your findings here so it doesn't get lost?

alastair87 commented 1 year ago

This is a basic Ubuntu-derived devcontainer for static HTML and node (very similar to the Microsoft ones, but it also installs the CYF extension pack):

https://github.com/alastair87-cyf/sample-devcontainer

dot-devcontainer can be added to the root of an existing project as .devcontainer. To run it locally you need Docker and the Remote Containers extension for VS Code installed (make sure you are opening it in the container). Notably this ought to work fine on Windows with Docker and WSL2 as well.

This is a fork of an existing CYF example with the .devcontainer added:

https://github.com/alastair87-cyf/cyf-slideshow-project

You can clone it and use the devcontainer locally or you can run it on Codespaces using the Code link at the top (it says 'paid for by alastair87-cyf` but it's using 60 hours of free credit for the month that I'm unlikely to ever use!!):

https://github.com/alastair87-cyf/cyf-slideshow-project

For some reason the terminal prompt does not render correctly in Codespaces even though it's fine on my local machine. I haven't figured out why this is yet. It's usable but instead of applying the colours it just prints out the style instructions. It also seems to have ignored the extension pack directive but has pulled in extensions I've been using elsewhere.

image

alastair87 commented 1 year ago

Locally (on a Fedora 37 host running the latest VS Code and upstream Docker), there seem to be no issues:

image

textbook commented 11 months ago

I had a play with Codespaces this morning, and with only moderate yak shaving was able to get it to run an app based on the starter kit, in a virtual environment, with a database, and even hot reloading on the client side: https://github.com/CodeYourFuture/tech-products-demo/compare/9c525bf...615f6f5.