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

switch local dev and addons-dev to python3 #10640

Merged
merged 3 commits into from Feb 12, 2019

Conversation

@eviljeff
Copy link
Member

commented Feb 8, 2019

fixes #10639

@eviljeff eviljeff requested review from EnTeQuAk and diox Feb 8, 2019

circle.yml Outdated
@@ -18,7 +18,7 @@ jobs:
name: Build docker image and push to repo
command: |
docker version
docker build -t app:build -f Dockerfile.deploy .
docker build -t app:build -f Dockerfile.py3.deploy .

This comment has been minimized.

Copy link
@EnTeQuAk

EnTeQuAk Feb 8, 2019

Member

These are used for addons-dev.allizom.org

This comment has been minimized.

Copy link
@eviljeff

eviljeff Feb 8, 2019

Author Member

yep. The commit is misnamed - the issue was about having addons-dev run python3 also.

circle.yml Outdated
@@ -18,7 +18,7 @@ jobs:
name: Build docker image and push to repo
command: |
docker version
docker build -t app:build -f Dockerfile.deploy .
docker build -t app:build -f Dockerfile.py3.deploy .

This comment has been minimized.

Copy link
@diox

diox Feb 8, 2019

Member

So, the main problem with that approach (with the other change below in the same file) is that we'd build latest (for dev) exclusively for python 3, and tags (for stage/prod) exclusively for python 2.

Also note that currently, for local dev, we use a different dockerhub repo (https://hub.docker.com/r/addons/addons-server instead of https://hub.docker.com/r/mozilla/addons-server) that is configured to build latest and latest-py3 (it's not currently configured to build a Python 3 image for tags/branches, but it could be trivially by just adding it to the docker hub settings). It'd be nice to be consistent (it'd be even nicer to use the same repo for everything, but eh, baby steps).

So, I think we need to do the following:

  • Build latest (still py2) and latest-py3 (obviously py3) with circle ci. Same for tags.
  • Deploy latest-py3 to dev (latest would be unused except for if/when we need to switch back) and don't change deploy for the rest for now.

This comment has been minimized.

Copy link
@eviljeff

eviljeff Feb 8, 2019

Author Member

Sounds good. What lines are you suggesting be changed exactly?

This comment has been minimized.

Copy link
@diox

diox Feb 8, 2019

Member

I'm not sure :) @autrilla do you know how we can do what I propose above efficiently? Can this be done in parallel ? Wouldn't want to make the deploys slower.

This comment has been minimized.

Copy link
@eviljeff

eviljeff Feb 8, 2019

Author Member

I reversed the Dockerfile changes but I'm not clear how it affects the way forward here. We do want the docker image deployed on dev to be the py3 one.

This comment has been minimized.

Copy link
@autrilla

autrilla Feb 11, 2019

Contributor

I'm not sure :) @autrilla do you know how we can do what I propose above efficiently? Can this be done in parallel ? Wouldn't want to make the deploys slower.

This can certainly be done in parallel with the (relatively) new CircleCI workflows. E.g. autograph runs several things in parallel:

This comment has been minimized.

Copy link
@diox

diox Feb 11, 2019

Member

We're already using workflows so it doesn't sound like we'd need to add much. We only need to care about the master branch deploys right now, so I think we need to:

  • Split build-deploy into 2 parts: a build part and a deploy part
  • Clone the build part, do a py2 and a py3 version
  • Make the deploy part require both builds in the workflow, and make it push both ${DOCKERHUB_REPO}:latest and ${DOCKERHUB_REPO}:latest-py3.

Bonus point for folding the build-release into the same jobs (just handling the fact that the docker tag is different) since it's essentially copy/pasted right now.

Once this is done, have ops make our pipeline on their end use the latest-py3 image - but crucially, we'll have both py2 and py3 versions available, letting us switch to either if needed.

Dockerfile Outdated Show resolved Hide resolved

@eviljeff eviljeff changed the title switch local dev to python3 switch local dev and addons-dev to python3 Feb 8, 2019

@autrilla autrilla force-pushed the eviljeff:10639-python3-on-dev branch 6 times, most recently from d6ee5bd to dcf89e0 Feb 11, 2019

@autrilla autrilla force-pushed the eviljeff:10639-python3-on-dev branch 12 times, most recently from f83d6f7 to 7dcef29 Feb 11, 2019

.circleci/config.yml Outdated Show resolved Hide resolved
Dockerfile.py3.deploy Outdated Show resolved Hide resolved
Adrian Utrilla

@autrilla autrilla force-pushed the eviljeff:10639-python3-on-dev branch from 7dcef29 to e12bfb4 Feb 12, 2019

@diox
diox approved these changes Feb 12, 2019
Copy link
Member

left a comment

looks good to me, let's wait for circle CI tests to finish and try that!

@autrilla autrilla merged commit ea04f8a into mozilla:master Feb 12, 2019

2 checks passed

ci/circleci: integration_test Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.