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

Add build and push step to GH Actions #1083

Merged
merged 23 commits into from Sep 21, 2022
Merged

Add build and push step to GH Actions #1083

merged 23 commits into from Sep 21, 2022

Conversation

adelavega
Copy link
Collaborator

@adelavega adelavega commented Sep 21, 2022

Makes changes to verify we can rebuild the image, and make it easier to deploy pre-built images.

  • Adds a new job to GH Actions that build the neuroscout image and pushes to GH Registry.
  • Changes the docker-compose.yml file such that it pulls from GHCR, and can be specified to be a pr, release version or master.

To-Do (not necessarily in this PR)

  • Integrate tests w/ image building.
    I attempted this but it became complicated because of docker-compose. I think a good setup would be one job for image build + push (without needing to pass tests for PRs) and in parallel a docker-compose build and test, like is done in neurostore.
    Otherwise, I think integrating pushing to GHCR and using that image with docker-compose is not clear to me.

(Note: It may be possible if we add a custom GHA only .yml which pulls the pre-loaded image, that would have a different name)

  • Modify deepdream and production deployment to use pre-built images, and pull / delete old images as necessary

@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2022

Codecov Report

Merging #1083 (b3679b2) into master (2c628af) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1083   +/-   ##
=======================================
  Coverage   78.21%   78.21%           
=======================================
  Files          63       63           
  Lines        3269     3269           
=======================================
  Hits         2557     2557           
  Misses        712      712           
Impacted Files Coverage Δ
neuroscout/populate/setup.py 42.60% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@cypress
Copy link

cypress bot commented Sep 21, 2022



Test summary

8 0 0 0Flakiness 0


Run details

Project Neuroscout
Status Passed
Commit 5de473d ℹ️
Started Sep 21, 2022 8:08 PM
Ended Sep 21, 2022 8:09 PM
Duration 00:56 💡
OS Linux Ubuntu - 20.04
Browser Electron 102

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@adelavega
Copy link
Collaborator Author

I think I'll leave tests as is, as its much faster to run tests without building the entire image

@adelavega
Copy link
Collaborator Author

The one issue is these don't take variables.
Currently I'm thinking we can stick with git hooks for deployment but with the following changes:

  • Both STAGING and PRODUCTION default to pull pre-built images
  • Environment variable determines which pre-built image is used. "stable" or equivalent tag can be used. In STAGING, one can always change this variable to test a new build. (Need to check if images are auto-pulled if updated)
  • STAGING machine defaults to building frontend changes in addition to doing up & down.
  • PRODUCTION machine defaults to using frontend changes pre-built in image to minimize downtime

For now we can test this working in STAGING by pushing by the user to the server. If this works, we can then add a way to trigger GH Action to push to staging given some tag. If that all works, we can then set up this working on production.

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.

None yet

2 participants