Skip to content

DRAFT: Improve DX: setup script for submodule and image syncing #21

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aprilrieger
Copy link

TO-DO

  • Update the build to use the base_image as well

Update to add bin/setup for submodule initialization and BASE_IMAGE automation

Story

As a developer working on a HykuKnapsack project,
I want a single setup script that initializes the Hyku submodule and automatically sets the correct BASE_IMAGE,
So that I can start coding immediately without having to manually manage submodule state or rebuild Docker layers unnecessarily.

Refs #<issue_number>

Expected Behavior Before Changes

  • Developers had to manually run multiple setup steps when starting work:
    • Initialize the hyrax-webapp submodule
    • Manually determine the correct SHA and update .env with the appropriate BASE_IMAGE
  • If the submodule SHA changed (e.g., via git checkout), the .env file would not be updated automatically
  • Builds could use outdated base images or default to :latest, which could lead to unnecessary rebuilds and slower startup times

Expected Behavior After Changes

  • Running ./bin/setup will:
    • Automatically initialize the hyrax-webapp submodule (if not already)
    • Set the BASE_IMAGE in .env to match the currently checked-out commit in the submodule
    • Install a post-checkout git hook to keep BASE_IMAGE updated when switching branches
  • Ensures the correct base image is used:
    • Matches the SHA of the hyrax-webapp submodule
    • Leverages Docker layer caching more effectively
    • Speeds up local development and reduces build inconsistencies

… to automate the base_image to the sha for the recently checked out branch so when you build the images you are using the cached base form hyku, 1. so it's the most recent, and 2. so it's quicker in development
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.

1 participant