-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
New monorepo deploys #366
New monorepo deploys #366
Conversation
This new script handles deployment of both Python and R Dash apps within a monorepo. At the moment, it will skip any apps that require redis, and also detects when the old-style monorepo was deployed in order to override the repository with the newer, slimmer methodology. This script is meant to be run from CI, and should be avoided if possible locally, though will still work, assuming the dds-client is available.
This made it more complex for others to reference the code - they'd need to remove the paths themselves - and also complicated our deployment process. With the new deploy process, we treat each app directory as if it was a single entity, using a temporary git repository if necessary to initialize the app, and update the app with history as appropriate.
These are useful for dashr apps where the default buildpack is not bundled with DDS at this time.
None of these work on playground at the moment, so they are just deploy noise.
95b2913
to
d31d692
Compare
cc @lundstrj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good -- just a couple of questions from me!
- dashr is completely disabled already, no need to re-enable here - the others seem to be fine on playground
Discussed with @shammamah, we're getting rid of the branch deploy mechanism. It's pretty clunky and not necessary now that deploys are much quicker than before. |
I'll delete all the branches post-merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃
The custom branch work is no longer necessary, as all branches other than master will now deploy to playground. Once an app lands in master, it will be deployed to gallery.
This was missing some environment variables in playground, but that has been fixed, so deploys work again.
I'll re-enable dash-gallery post-merge. |
I'm so happy you are doing this @josegonzalez |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃 LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Just one small comment.
log-info "exists: false" | ||
if [[ "$CREATE_APP" == "true" ]]; then | ||
log-warn "$APP not found, creating" | ||
dds-client apps:create --name "$APP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! So much faster than going to the web interface to create an app :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah and hopefully at some point I add support for creating redis/postgres for the apps too!
log-header "Deploying $APP" | ||
log-info "dashr: ${is_dashr}" | ||
if [[ "$is_dashr" == "false" ]]; then | ||
local celery_version="$(cat "$app_dir/requirements.txt" | grep -E "^celery=")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can also take the form celery>={version}
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually don't use celery in any of these apps, but once I add this to other monorepos, I'll keep that in mind - and come back to update this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💃
Issue: plotly/streambed#13854
App pull request
About
This pull request re-implements the deployment process in order to treat each app within the
apps
directory as a standalone application. In the future, developers will develop dash apps as if they were in their own, standalone repositories, and the deployment process would take care of injecting anything custom into place.This allows us to remove a ton of path hacks within each dash app, which simplifies copy paste. As a byproduct, we are no longer shipping the entire repository for each app, which minimizes the overall image size as well as allows us to take advantage of the deploy build cache.
One thing this removes is the ability to push from local in a straightforward manner. You'll need to use the
./deploy
script with the proper environment variables - it will complain when they aren't set! - in order to continue deploying as normal. Hopefully this pushes folks to use CI in the future instead of deploying from local though :)This has already been tested on dash-playground, where the overall disk utilization went down to 120GB (its a bit higher now due to my attempts at installing the
dashr
apps) from ~900GB (I also did some manual cleanup of old images/containers but thats besides the point).Workflow
N/A
The pre-review review
I have addressed all of the following questions:
any dead and/or irrelevant code.)
readable and, where it isn't, it has been commented appropriately.)]
lessen the volume of code that needs to be maintained.)
Synthetic Deploy Demo
An app deploy now takes ~2 minutes, an entire CI run should be ~5min (about 10-15 seconds to check if a given app needs to be updated).
CI runs can be done in parallel and as long as they don't hit a specific app, we can more or less safely merge a ton of PRs at the same time :)
Todo
dashr
apps and maybe re-enable once they are fixed.