feat(docker): add docker support with circle-ci #1692
Conversation
827123f
to
99aa4c0
There's a cron job running every 10 minutes on an EC2 instance, which does:
At the moment, I don't understand how that would work. But if we can make it work, obviously it's fine. Are you volunteering to make it work? Some of the things I don't understand yet:
Would we need to shift the responsibility for those things into the cron script, or can we still lean on Circle to do it for us? |
|
@philbooth can we do a conditional, such that |
What a capital idea! Circle lets you set env vars for builds right? We could set one of those? |
https://circleci.com/docs/1.0/environment-variables/#build-details |
2f45c65
to
9c66e23
I looked into doing this, and it may not be easily possible. The problem is that we need different directives in the We could either:
|
a4503e3
to
37cdf01
|
Well heyyy! It's working! Some notes I've been keeping:
|
| RUN node scripts/gen_vapid_keys.js | ||
|
|
||
| USER root | ||
| RUN chown root:root /app/config |
seanmonstar
Mar 4, 2017
Author
Member
I didn't like the idea of leaving the config directory forever writable by the app, cause a mistake on our part could mean changing a config file out from under us?
I didn't like the idea of leaving the config directory forever writable by the app, cause a mistake on our part could mean changing a config file out from under us?
jbuck
Mar 6, 2017
Member
I don't think you need to worry about changing the permissions here - we'll just ignore the config file
I don't think you need to worry about changing the permissions here - we'll just ignore the config file
seanmonstar
Mar 7, 2017
Author
Member
For completeness, this is just setting the permissions of the directory back to what they were because of the COPY.
For completeness, this is just setting the permissions of the directory back to what they were because of the COPY.
| @@ -0,0 +1,3 @@ | |||
| FROM fxa-auth-server:build | |||
| ENV FXA_L10N_SKIP 1 | |||
seanmonstar
Mar 4, 2017
Author
Member
This is already downloaded in the Dockerfile-build npm install step, but by the time we get here, we no longer have permission to remove files from node_modules, and the download_l10n.sh script causes npm to unconditionally remove a directory to try to replace it.
So, I settled on skipping it here.
This is already downloaded in the Dockerfile-build npm install step, but by the time we get here, we no longer have permission to remove files from node_modules, and the download_l10n.sh script causes npm to unconditionally remove a directory to try to replace it.
So, I settled on skipping it here.
| - | | ||
| if [ -e fxa-js-client ]; then |
seanmonstar
Mar 4, 2017
Author
Member
The changes to this file are probably a lot easier to grok if using the split diff view.
The changes to this file are probably a lot easier to grok if using the split diff view.
|
|
||
| cd fxa-content-server && CONFIG_FILES=server/config/local.json,server/config/production.json node_modules/.bin/grunt serverproc:dist 2>&1 | tee $HOME/fxa-content-server.log & | ||
|
|
||
| cd fxa-oauth-server && LOG_LEVEL=error NODE_ENV=dev node ./bin/server 2>&1 | tee $HOME/fxa-oauth-server.log & |
seanmonstar
Mar 4, 2017
Author
Member
I wasn't certain if the & suffix was enough to mimic the background directive for Circle...
I wasn't certain if the & suffix was enough to mimic the background directive for Circle...
philbooth
Mar 6, 2017
Contributor
It's not unfortunately, the circle docs suggest that we probably need to use nohup, but I haven't found the correct incantation to get it all working yet. Most of the servers are up and running when I SSH into the box post-build, but the content server is always dead. Haven't managed to make it dump any useful error information yet either.
It's not unfortunately, the circle docs suggest that we probably need to use nohup, but I haven't found the correct incantation to get it all working yet. Most of the servers are up and running when I SSH into the box post-build, but the content server is always dead. Haven't managed to make it dump any useful error information yet either.
| test) | ||
| cd fxa-js-client && npm run test-local | ||
|
|
||
| cd fxa-content-server && retry -n 1 -- node_modules/.bin/intern-runner config=tests/intern_functional_circle firefoxBinary=$HOME/fxa-auth-server/firefox/firefox fxaProduction=true |
seanmonstar
Mar 4, 2017
Author
Member
There was a parallel directive for this command in the circle.yml, but I wasn't certain why, and what exactly it did, so this line currently just executes serially.
There was a parallel directive for this command in the circle.yml, but I wasn't certain why, and what exactly it did, so this line currently just executes serially.
philbooth
Mar 6, 2017
Contributor
It only costs us a bit more time to wait for the build, not the end of the world if we lose it.
It only costs us a bit more time to wait for the build, not the end of the world if we lose it.
|
@seanmonstar, I had to fix a few things to get the cross-repo testing working, you can see my changes in Of course, I say "working", but really I mean "working-ish" because the content server isn't running so the tests all fail still. See my comment about |
Yeah, this is kinda annoying but it's the easiest way to ensure tests run
Yep! |
| @@ -0,0 +1,30 @@ | |||
| FROM mhart/alpine-node:4.8.0 | |||
|
|
|||
| RUN apk update && apk upgrade && apk add git make gcc g++ linux-headers openssl python | |||
jbuck
Mar 6, 2017
Member
Damn, sucks that we need all these dependencies.
Could this be reduced to apk add --no-cache git make gcc g++ linux-headers openssl python ?
Damn, sucks that we need all these dependencies.
Could this be reduced to apk add --no-cache git make gcc g++ linux-headers openssl python ?
|
from mtg: content server needs a fix for nohup. |
|
Just so I know where we are, did the content server issue get fixed or should I open an issue for it? |
|
Ugh the circle thing didn't run at all, the 2 listed checks were travis |
|
I merged your branch into this, but I think it was still failing, right? |
No dramas, I'm happy to try and get it fixed up asynchronously. And yeah, I switched off circle again after our conversation yesterday, was that the wrong thing to do? |
|
Wat |
|
@philbooth nah, no worries. I checked the code and the thing showed all green, but it was 2 instead of 3. This is running Circle now: #1703 |
This takes over the
circle.ymlfile to be used for our docker publishing, to be similar with our other repos.@philbooth I'm not certain exactly how the fxa-test repo updates itself, but perhaps instead of using a complete mirror, what if we just made a small repo in the fxa-test org that essentially just has the old
circle.yml, and let that run?