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

Faster-dev #22701

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Faster-dev #22701

wants to merge 1 commit into from

Conversation

KevinMind
Copy link
Contributor

@KevinMind KevinMind commented Sep 25, 2024

Relates to: mozilla/addons#15028

Description

  • Introduce OLYMPIA_UID build arg in our docker build that is set to the HOST_UID ONLY on local builds
  • Modify Dockerfile to make development stage skip all production asset/compilation steps
  • Modfiy entrypoint.sh to check if the olympia UID matches the HOST_UID, and if it does not modify the olympia user ID (as before) and additionally modify the directory ownership of /data/olympia
  • merge storage and data_static mounts into single data_olympia mount shared between web and nginx containers.
  • Remove docker-compose.ci.yml as a redundant configuration file (update relevant CI configs)

Context

This PR reconfigures our docker compose setup such that local builds only include the base stage + development dependencies skipping most asset/local/source steps. These steps are somewhat redundant for most development use cases and increase build times. Removing them means smaller, faster local images.

The downside to this is our local image is "missing" things. The rest of the PR is modifying our local setup in a way the ensures the local container includes everything missing from the build and additionally ensures compatibility with remote images.

Our local setup now needs to understand if we are building locally or using a remote image and depending on this will:

  • modify the UID of olympia on local builds, simplifying file ownership between the host and container
  • modify the file ownership in the container on remote images, ensuring compatibility with images built with non host UIDs

Some issues currently with this PR include:

  • some CI steps failling due to missing files from the build (they need to be "recreated" in CI or those spefific CI steps should target the production stage (latter is probably better for resiliance)
  • running the app locally in PROD mode is more complicated because there are more degrees of freedom. we probably want to have a specific make flag for prod mode which would set the appropriate parameters
  • we currently push CI images to dockerhub that now will not work because they are not local but are not targetting production so woulld be missing files.

Testing

make down && time make up

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@KevinMind KevinMind force-pushed the faster-dev branch 6 times, most recently from 42e668b to 686c960 Compare September 25, 2024 16:07
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