Skip to content

Updating the Models Library

Jeremy B edited this page Dec 1, 2023 · 9 revisions

Updates to the NetLogo models library have to be copied in a manual process to Galapagos for deployment. It may be possible to automate some of these steps, but for the time being this hasn't been a big enough burden that's done frequently enough to warrant it.

The steps to update the models library are pretty straightforward. We use Tortoise as the starting point, since we want to run some quick compiler and engine tests on the updates before deploying them to Galapagos and netlogoweb.org. Once Tortoise is updated, we copy models to Galapagos, then do some clean-up, and commit the changes.

Tortoise

These commands assume you're running in the Tortoise repository directory.

  • Get the Tortoise repository's models submodule set to the desired commit (find with git log or check GitHub).
cd models
git fetch
git co master
git pull
git reset --hard $COMMIT_HASH
  • Run model dumps to see what changed.
    • netLogoWeb/testOnly *ModelDumpTests
  • Run changed models through the TestModels tests, just in case. Resolve any issues.
    • netLogoWeb/testOnly *TestModels -- -z ChangedModelOne -z ChangedModelTwo
  • Add and commit the models and any testing fixes in Tortoise.
    • git add models
    • git commit -m "Infra: Update models library"

Galapagos

Now to actually update Galapagos. These commands assume you're running in the Galapagos repository directory.

  • Delete the contents of the existing public/modelslib Galapagos folder.
    • rm -rf public/modelslib/*
  • Copy the contents of the Tortoise models folder to the public/modelslib Galapagos folder. So ../Tortoise/models might be the Tortoise repo path, depending on your setup.
    • cp -r path/to/models/* public/modelslib/
  • Remove some excess directories and files that come along for the ride.
    • bin, src, and project are currently the ones that need removing, depending on how the library changes there may be more or less.
    • rm -rf public/modelslib/{.github,.gitignore,.jvmopts,bin,build.sbt,crossReference.conf,sbt.sh,src,project}
  • Commit the new and updated Galapagos modelslib files.

Once the Galapagos commits are pushed to the production branch, the GitHub Actions setup will take care of copying the files off to the production server (see the Actions main.yml file).

Clone this wiki locally