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

Split Docker Build to accept build args to optionally include swift support #741

Merged
merged 9 commits into from
Nov 29, 2020

Conversation

nlaurance-pyie
Copy link
Contributor

added dockerignore for slimer build context
parametrized dockerfile

making swift support optional

nil/bandersnatch 3.9 9f730c999230 2 minutes ago 156MB
nil/bandersnatch 3.9-swift 91d50bd7103d 4 minutes ago 280MB

hopefully addressing #740 also

nlaurance-pyie and others added 2 commits November 20, 2020 17:32
added dockerignore for slimer build context
parametrized dockerfile
@codecov
Copy link

codecov bot commented Nov 20, 2020

Codecov Report

Merging #741 (6a2bce4) into master (446e26c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #741   +/-   ##
=======================================
  Coverage   79.90%   79.90%           
=======================================
  Files          15       15           
  Lines        2140     2140           
  Branches      311      311           
=======================================
  Hits         1710     1710           
  Misses        320      320           
  Partials      110      110           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 446e26c...6a2bce4. Read the comment docs.

Copy link
Contributor

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I think it's going to break automation.

2 questions:

  1. How des this remove the setuptools dep? We use import from it
    e.g. filter.py + storage.py import pkg_resources
  1. I feel this will need to pass this arg to the docker building GitHub action

@@ -1,28 +1,48 @@
FROM python:3.9 as base
ARG PY_VERSION=3.9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet - 1 spot is way better!

@nlaurance-pyie
Copy link
Contributor Author

1/ poor phrasing, sorry. it's just out from requirements and setup. Still needed tho. its presence triggered warning

@nlaurance-pyie
Copy link
Contributor Author

! refs/heads/docker_py_version:refs/heads/docker_py_version [remote rejected] (refusing to allow an OAuth App to create or update workflow .github/workflows/docker_upload.ymlwithoutworkflow scope)

name: bandersnatch_docker_upload

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Publish to Docker Registry
        uses: elgohr/Publish-Docker-Github-Action@master
        env:
          PY_VERSION: 3.9
        with:
          name: pypa/bandersnatch
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
          snapshot: true
          buildargs: PY_VERSION
          tags: "swift-latest, swift-3.9, swift-3"
      - name: Publish Swift variation to Docker Registry
        uses: elgohr/Publish-Docker-Github-Action@master
        env:
          PY_VERSION: 3.9
          WITH_SWIFT: yes
        with:
          name: pypa/bandersnatch
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
          snapshot: true
          buildargs: PY_VERSION, WITH_SWIFT
          tags: "latest, 3.9, 3"

@cooperlees
Copy link
Contributor

1/ poor phrasing, sorry. it's just out from requirements and setup. Still needed tho. its presence triggered warning

What warning? Seems weird to remove something we know is a dep. If you can't work it out can you leave it and open an issue and I'll try fix it.

! refs/heads/docker_py_version:refs/heads/docker_py_version [remote rejected] (refusing to allow an OAuth App to create or update workflow .github/workflows/docker_upload.ymlwithoutworkflow scope)

What's this? Do I need to do something here?

@nlaurance-pyie
Copy link
Contributor Author

1/ issue is similar to pypa/pipenv#1417 (setuptools shouldn't be a dependency since you cannot install dependencies without it in the first place)
now, I don't mind to put it back

the other matter is it seems I cannot push any changes in the .github repo. And you would need to evaluate my changes yourself, I'm afraid. It makes the image without swift support the standard one, and also build a variation with the optional swift support.

@cooperlees
Copy link
Contributor

Really, .github should just checkout like any other directory. Worst comes to worst I can look at merging your changes, but there is no protection to the .github directory that I know of.

@nlaurance-pyie
Copy link
Contributor Author

.github is checked out alright, but I can't push .
it seems a security feature.

Also, that Dockerfile doesn't build on raspberry pi ;(

@cooperlees
Copy link
Contributor

TIL. Ok, well I can fix that post merging this.

Raspberry Pi has never been a target platform. File an issue with the errors + a repro and I or someone else will see if we can fix it.

@cooperlees
Copy link
Contributor

cooperlees commented Nov 23, 2020

Please fix lint:

Fix End of Files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing MAINTAINERS.md
Fixing .dockerignore

@cooperlees cooperlees changed the title removed setuptools as dep Split Docker Build to accept build args to optionally include swift support Nov 24, 2020
@cooperlees
Copy link
Contributor

I'm looking to release this week so if you could fix the lints + put setuptools back so we can see what version we test with and what version each release / docker container uses that would be grand.

@cooperlees
Copy link
Contributor

Thanks. Will merge soon when I have time to fix the docker image building etc. right after merging.

@cooperlees cooperlees merged commit 43515a1 into pypa:master Nov 29, 2020
@cooperlees
Copy link
Contributor

This still build and uploaded a docker image:
https://github.com/pypa/bandersnatch/runs/1471070904

Will try a PR with your suggested changes tho.

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