-
Notifications
You must be signed in to change notification settings - Fork 1
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
Move deployment to dokku #385
Conversation
When we've upgrade fabric3 to standard fabric on OP and fdaaa, we can do the same here. Until then we're stuck at 3.9
… in docker anyway
I am fairly confident that the only thing that used this callback url was a very old edition of cohort-extractor 22fba6e
…b can live elsewhere This means that the non-root docker user doesn't need write access to files that exist only in the container.
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 really good, thanks for doing this.
docker/Dockerfile
Outdated
# | ||
# Not including the code at this stage has two benefits: | ||
# | ||
# 1) this image only rebuilds when the handlful of files needed to build output-explorer-base |
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.
s/output-explorer-base/bennettbot-base/
DEPLOY.md
Outdated
|
||
ebmbot is deployed on smallweb1 and is managed by systemd. | ||
Deployment uses `dokku` and requires the environment variables defined in `dotenv-sample`. |
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.
This implies (to me) that it reads the environment variables from dotenv-sample
, but I don't think that's the case. Can you clarify?
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.
No, this is a leftover from when I thought I was going to put dummy env vars in dotenv-sample, but eventually didn't. It's only there for local development now
DEPLOY.md
Outdated
|
||
ebmbot is deployed on smallweb1 and is managed by systemd. | ||
Deployment uses `dokku` and requires the environment variables defined in `dotenv-sample`. | ||
It is deployed to our `dokku3` instance. |
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.
I'd mention at the top that it's deployed automatically.
ebmbot/webserver/callback.py
Outdated
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.
Agree this is safe to remove. Had completely forgotten we supported generating cohorts via Slack!
ebmbot/dispatcher.py
Outdated
@@ -162,7 +163,7 @@ def notify_end(self, rc): | |||
else: | |||
return | |||
else: | |||
msg = f"Command `{self.job['type']}` failed (find logs in {self.log_dir}). Calling tech-support." | |||
msg = f"Command `{self.job['type']}` failed (find logs in {self.host_log_dir}). Calling tech-support." |
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.
Can we say "find logs in ... on dokku3"?
for reporting location of log files when jobs fail
Moves deployment of BennettBot to a dokku app on dokku3.
In the process, I've removed the webserver /callback endpoint, and the code in dispatcher.py that builds it. As far as i can tell, this wasn't being used by anything. In the past it was used by cohort-extractor, back when the slack bot was used to run cohort-extractor commands - 22fba6e. No jobs in job_configs.py use the
EBMBOT_CALLBACK_URL
.I also added a couple of extra settings, most notably the
FAB_WORKSPACE_DIR
, which means that fabric jobs, which fetch a fabfile from a remote repo and create a workspace dir to put it in, can write those files to a directory in the mounted storage volume, which the non-root docker user has access to.Currently this is deployed on dokku3 using the the test BennettBot and workspace (bennetttest.slack.com) and commands are working (including
op
ones). Once merged, it needs the following environment variables updated to the real BennettBot:OpenPrescribing will also need its webhook payload URL updated https://github.com/ebmdatalab/openprescribing/settings/hooks/85994427
Still to do (in a later PR):