Skip to content

Conversation

jennydaman
Copy link
Contributor

This PR adds a justfile, an 80-line replacement to the over 1,400 lines of bash scripts we use for development.

$ just --list --unsorted
Available recipes:
    dev                     # Start the ChRIS backend in development mode, and attach to the live-reloading server.
    start                   # Start the ChRIS backend in development mode.
    up                      # Start services (without running database migrations).
    attach                  # Attach to the chris container.
    shell                   # Open a Python shell.
    bash                    # Open a Bash shell.
    chrisomatic             # Run chrisomatic, a tool which adds plugins and users to CUBE.
    postscript              # Run chrisomatic with the contents of chrisomatic/postscript.yml
    migrate                 # Perform database migrations.
    test *args              # Run tests, e.g. `just test pacsfiles`
    test-all                # Run all tests.
    test-unit               # Run unit tests.
    test-integration        # Run integration tests.
    start-dependencies      # Start dependency services.
    down                    # Stop services.
    nuke                    # Stop services and remove all data.
    reap-plugin-instances   # Remove all plugin instance containers.
    build                   # (Re-)build the container image.
    pull                    # Pull container images.
    run +command            # docker-compose ... run helper function.
    docker-compose +command # docker-compose ... helper function.

Advantages

  • maintainability: declarative and >10x fewer SLoC
  • performance: make.sh has a lot of overhead, just is simpler and faster
  • sane defaults: run just instead of docker swarm leave --force && docker swarm init --advertise-addr 127.0.0.1 && ./unmake.sh && sudo rm -fr CHRIS_REMOTE_FS && rm -fr CHRIS_REMOTE_FS && ./make.sh -U -I -i
  • clarity and convenience: you can easily run subcommands and tests like just test pacsfiles instead of one-letter flag arguments
  • switched from using docker swarm to just docker
  • switched from using swift storage to filesystem storage

@jennydaman
Copy link
Contributor Author

Old documentation is kept around in OLD_DEVELOP.md

@jennydaman jennydaman merged commit b250b20 into FNNDSC:master Aug 29, 2024
@jennydaman jennydaman deleted the just branch August 29, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants