Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create offline version for use in prisons and other offline environments #550

Open
monstermaker opened this issue Dec 7, 2022 · 10 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@monstermaker
Copy link

Which module(s) and week(s) does this change affect?
Module(s): All
Week(s): All

What is the work that needs to be done?

  • All resources need to be available with no internet connection after the initial download. It is useful if this environment is installable on a LAN with a Linux-based server delivering the syllabus.
  • All the external systems such as GIT will need to be installed separately on the LAN, alternatives found or not used in the case of community-based systems such as Slack, so the references to these would also need to reflect this.
  • Offline would mean that the whole shipping process would change - this would need more research to a suitable process.
  • The Intro to Digital content is mostly done already in the prison, so working on aligning this with the CYF version may be required as this is separate from the main syllabus section.
  • CYF Blocks will need to be made as a standalone version or an alternate found.
  • Any external libraries/repositories such as React or Node will need offline versions and referenced accordingly

How far the course takes students and how we assess learning will need further discussion.

Why is this work important to do?

This opens the CYF to serving prisoners giving them a start on their tech career and helping to reduce the risk of reoffending.

Additional context

Who might need to know about this change?

@monstermaker monstermaker added the enhancement New feature or request label Dec 7, 2022
@illicitonion
Copy link
Member

Thanks for filing this issue, it's a really exciting effort to work on!

A few follow-up questions:

  1. For the serving environment for the course material, what's the ideal deployable? A static zip/tar of HTML and resources? A linux x86-64 executable that can serve HTTP on a port? A PDF? Something else?
  2. What machine spec should we assume the people taking the course will have access to? Linux / Windows / Mac / a mix / ?
  3. How easy is it to vendor CLI or desktop applications onto the machines in use? I'm more thinking for later on in the course, if we wanted to have people use git locally, GitHub Desktop in an offline or local-network mode, VS Code, NodeJS, Postgres, etc...
  4. How easy is it to ship updates to the course materials? And how frequently?

The Intro to Digital content is mostly done already in the prison, so working on aligning this with the CYF version may be required as this is separate from the main syllabus section.

Is there a copy of the material already being delivered? It'd be great to converge them where possible!

Adding to the future topics for discussion, also:

  • How viable is it to arrange video or in-person sessions?
  • A lot of our coursework later on on the course is delivered via git on GitHub. Partially this is just as a delivery mechanism and can be trivially swapped out, but partially it's because getting used to Git and GitHub are useful skills to develop. I guess we could potentially try to get a GitHub Enterprise deployment? Or self-host one of the GitHub clones like https://gogs.io/ - regardless, something to discuss :)

@monstermaker
Copy link
Author

Thank you for your feedback and questions.

  1. The deployable could be a Linux executable with HTTP, as I think it would be best if it is better for it to look similar to the current live version. that way those leaving who would continue their learning outside would be already familiar with the environment. I have already cloned the git repository and now have it running locally on a machine. I intend to try this out on the Linux server to get a feel of what works and what doesn't without the internet. I think for future reference the best overall package would be a docker package. that way it would work more predictably than those that may be served on different LAMP stacks.
  2. The current machines in use are Windows 10 machines with a VirtualBox installed and a Ubuntu machine installed on that. this way the students start in Windows, which they are familiar with and then later after learning the HTML/CSS basics, move into a Linux environment. they are steered toward using Google Chrome as the browser, but many also use Firefox. So, delivering the majority over HTTP would make it easy to deploy.
  3. Installing applications on Windows machines is not easy due to the policies set in place and the almost impossible task of having it signed off by cyber-security. This was another reason for the choice of using the Linux VM as we can install any software on that machine. the machines have VS Code, NodeJS, Git, Python and MongoDB installed and the VMs also have a LAMP stack, PHPMyAdmin and ruby on Rails.
  4. Update shipping can be an easy task as we provide updates to the VM about 4 times a year. If the main parts of the course were run on the Linux server then they can be done as regularly as required as it is a central source. The VM updates are usually done using a batch file to update each machine from the central server. This requires thawing the Deepfreeze machine (clients), deployment and then re-freezing. This is usually at least an overnight job.

The current material is mostly on a Moodle setup with some bookwork to supplement. It relies on a mixture of Moodle-based activities and assessments and videos. The details of these can be discussed in a more detailed discussion session.

Locally we server GitLab for our Git repositories, so that users can use Git. We also have a webserver setup which can have reseller-style packages set up on it so the students can use DNS, Mail and FTP etc. We also have StackOverflow running on a Kiwix server. We also serve W3Schools and FreeCodeCamp across the network, both of which are offline versions.

It is totally viable for future discussions to be over video or phone, though in-person is more difficult without you coming here (which can be arranged).

@ChrisOwen101
Copy link
Contributor

ChrisOwen101 commented Dec 8, 2022

@illicitonion @monstermaker

Not sure if this is useful but Docusaurus (the tool that this website is built with) has PWA/Offline Caching built in

https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-pwa#offline-mode-precaching

@monstermaker
Copy link
Author

@illicitonion @monstermaker

Not sure if this is useful but Docusaurus (the tool that this website is built with) has PWA/Offline Caching built in

https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-pwa#offline-mode-precaching

Yes, as this is precaching rather than just caching, this can prove useful.

We will still need to make sure we have the other external resources/facilities and these will need to be referenced/linked in the main offline web app.

@SallyMcGrath SallyMcGrath added the help wanted Extra attention is needed label Jan 14, 2023
@SallyMcGrath
Copy link
Member

@SallyMcGrath SallyMcGrath mentioned this issue Feb 2, 2023
@gregdyke
Copy link
Contributor

gregdyke commented Feb 2, 2023

Neil and I met on 2/2/2023 and here is what we did/concluded:

It would be good to know who has ownership of various action points from the above Jamboard so we can chase them up

  • Grasshopper
  • Scrimba
  • APIs
  • Codewars

Neil was wondering how the PD syllabus happens in practice (I gave my best understanding which is that ideally it would be well integrated with the tech syllabus so that it's clear to trainees that PD skills are highly valued and relevant. In practice, they are given a little bit independently, but giving them on the same day is helping draw bridges and connections. In the future, we hope to make the links stronger and more obvious to trainees ? and improve agile skills/understanding?)

Neil has considered the problem of local deployment/replacing our use of heroku/netlify. Currently they do it with ftp/filezilla to a server (and because some of their trainees are learning over multiple years, they have opportunity to learn a lot more about ops type stuff than our trainees). IMO that is a fine way of doing the deployment. It miiiight be nice to have some kind of autodeploy from gitlab for final projects, but the only real requirement from my perspective is the opportunity to see how a dev and prod environment might glue together differently

We did a bit of work on making CYF Blocks available offline. It looks like it needs a server of some kind to serve the .md files. For now we created https://github.com/CodeYourFuture/fundamentals-blockly/tree/blockly-offline which pulls in blockly and zero-md from node_modules instead of cdn/unpkg. Neil will try checking it out and deploying on their apache server.

  • fork/clone/checkout
  • npm install
  • copy folder over to apache
  • ...?
  • profit???? (ideally it just works at that point)

Maybe some kind of build script into a dist folder would be a better thing than reading directly from node_module?

@SallyMcGrath
Copy link
Member

SallyMcGrath commented Feb 9, 2023

Updates from me:

    • I've written to Grasshopper to ask if it's offlineable. There are no service workers on their desktop app -- it's not a PWA
  • Screenshot 2023-02-09 at 10 30 02
    • I also met with TLM and it was very interesting but not very actionable
    • I updated Neil on this in a catchup as I missed our meeting, but let's get it posted up here too!

@monstermaker
Copy link
Author

Update on CYF Blocks offline:

Installed Greg's update on the Apache server but did not work. It was still trying to get various resources from the web.

I had to get zero-md onto a local machine and then recreate the node_modules folder with missing modules. this was uploaded to the server giving 13 errors of missing resources. It appears that the zero-md module was missing some of the requested files, which they load from a cdn and this is built into the code.
I edited this module to use local resources and downloaded the markdown and prismjs modules. This then gave 49 errors for missing resources. I had to edit the prismjs and markdown modules to also use only local resources and download some extra JS files as the references only used the minimised versions which I could not find complete. This reduced to 1 error for the github-markdown css file.
when running another 73 errors appeared which were for some blockly resources for sound files and sprites. I sourced and downloaded these files and edited the blockly module to use these local resources, creating a new 'media' folder in the CYFblocks root folder.
This now appears to work offline.

Further to this, we could now attach this to a PWS module and it should be able to run on a local machine without internet ref: CodeYourFuture/fundamentals-blockly#56

@gregdyke
Copy link
Contributor

Oh god, what a yak-shaving expedition. I'm glad you resolved it in the end!

@SallyMcGrath
Copy link
Member

https://github.com/CodeYourFuture/CYF-Sandbox/tree/ITD for Codepen replacement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
No open projects
Status: In progress
Development

No branches or pull requests

5 participants