Updating G-Cubed in Codespaces for any G-Cubed model
Table of contents
The following instruction presume:
- You have been given access to a private McKibbin Software Group Github repository that provides access to a specific G-Cubed model.
- You are using the G-Cubed model in Github codespaces
Updating your devcontainer definition
Your devcontainer definition is provided for you as a Github repository that contains the definition of the devcontainer that you work in.
It will have been modified by McKibbin Software Group staff so your definition is already updated. You just need to apply the updates.
Updating your G-Cubed software
Restart your codespace. Once the codespace has opened you need to start a devcontainer rebuild from within VS Code by running the VS Code task called Devcontainers: Rebuild Without Cache and Reopen in Container
. This task can be found in VS Code by typing Command + SHIFT + P
in macOS or CTRL + SHIFT + P
in Windows to access the task list and then typing rebuild to find the right task. Click on the task to run it. Alternatively, if using a Github Codespace, click on the blue button in the lower left corner (the one you use to close devcontainer) and select the Rebuild Container
option from the menu of options that are shown. If asked, select the “Full Rebuild” option to ensure that caches are cleared and you get the latest updates of software.
This will cause the codespace to close and then set up the virtual machine again, while keeping all of the data (e.g. results and experiments) in your existing codespace intact.
Once the Codespace has rebuilt and reopened, your G-Cubed software will be up to date.
Updating your G-Cubed model
Open a terminal in your Codespace and use the following commands, one after the other, to pull down model updates from Github.
git checkout main
git pull
The first command ensures you are on the main branch - where updates are supplied.
Use git to merge the updates to the main branch with any other branches you are working with. Instruction on how to do these merges is out of scope for this documentation.
At this point your devcontainer, your G-Cubed software, and your G-Cubed model will all be updated.
Updating your baseline projections
Updates will often have an impact on your baseline projections. Once the updates have been done, rerun the model baseline. To do this, delete all of the files in the /results/<VERSION>/<BUILD>/run_fast_baseline
folder. Then run the run_fast_baseline.py Python script as you did before.
Some of the operations above use Git, a powerful but complex tool for version control of text documents (source code and, for us, data files). VS Code does provide quite a bit of help with using Git, but understanding Git itself is helpful. Github provides excellent resources to develop this understanding if Git.