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

Build context #2607

Merged
merged 36 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
33c6434
Multiple docker ignore files
greenape Apr 13, 2020
392c020
Update docker
greenape Apr 22, 2020
fcc8bf9
Newer machine image
greenape Apr 22, 2020
7a35942
Update machine image
greenape Apr 22, 2020
fab1253
Don't upgrade everything
greenape Apr 22, 2020
3219364
Use machine for building other images too
greenape Apr 22, 2020
787912e
Make me a sandwich
greenape Apr 22, 2020
f00c4a0
Remove entrypoint copy
greenape Apr 22, 2020
5faa73e
Twiddling workdirs
greenape Apr 24, 2020
ae2b727
Fix uwsgi path
greenape Apr 27, 2020
cc4e79b
Tweaking build and copy paths
greenape Apr 27, 2020
008ae46
Update machine image
greenape May 26, 2020
a08b8c8
Update remote docker
greenape May 26, 2020
b9c0f8c
Update python
greenape May 26, 2020
7d3129e
Update config.yml
greenape May 26, 2020
2ce39db
Use 3.8 for flowdb tests
greenape May 28, 2020
4d1efd5
Correct machine image and dockerfile name
greenape May 28, 2020
bedacc8
Don't need to upgrade docker now
greenape May 28, 2020
26712c2
Correct cache key
greenape May 28, 2020
5e3e57f
Correct path to testdata pipfile
greenape May 28, 2020
3d2f024
Unexclude pipfile
greenape May 28, 2020
a30c0c8
Remove synth data stuff from testdata image
greenape May 28, 2020
e84495b
Fix install command
greenape May 28, 2020
67701dc
Fix path
greenape May 28, 2020
6fe87ef
Move to the module directory
greenape May 28, 2020
5231ec2
Bump python version for flowetl tests
greenape May 28, 2020
979fa0e
Correct tests paths
greenape May 28, 2020
8ca68d9
Revert "Bump python version for flowetl tests"
greenape May 28, 2020
5d414f0
Revert "Correct tests paths"
greenape May 28, 2020
b6ba583
Newer python version?
greenape May 28, 2020
b2780ce
drop to older machine image
greenape May 28, 2020
b52a11a
Drop python version
greenape May 29, 2020
3f07b93
Fix flowauth install
greenape May 29, 2020
f9aefe6
Correct machine image
greenape Jun 1, 2020
409c39f
move entrypoint script to avoid directory name issues without tagged …
greenape Jun 1, 2020
6ed52a5
Bump deps
greenape Jun 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 43 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ executors:
jobs:
build_flowdb:
machine:
image: circleci/classic:201808-01
image: ubuntu-1604:202004-01
working_directory: /home/circleci/project
environment: *flowdb_env
steps:
Expand All @@ -159,23 +159,23 @@ jobs:
- attach_workspace:
at: /home/circleci/
- restore_cache:
key: flowdb-deps-1-{{ checksum "flowdb/Pipfile.lock"}}
key: flowdb-deps-1-{{ checksum "flowdb/tests/Pipfile.lock"}}
- run:
name: "Switch to Python v3.7"
name: "Switch to Python v3.8.2"
command: |
pyenv versions
pyenv global 3.7.0
pyenv global 3.8.2
- run:
name: Install pipenv
command: pip install --upgrade pip pipenv
command: pip install --upgrade pip pipenv virtualenv
- run:
name: Install python dependencies
command: |
PIPENV_PIPFILE=flowdb/Pipfile pipenv install --deploy --dev
PIPENV_PIPFILE=flowdb/tests/Pipfile pipenv install --deploy --dev
- save_cache:
key: flowdb-deps-1-{{ checksum "flowdb/Pipfile.lock" }}
key: flowdb-deps-1-{{ checksum "flowdb/tests/Pipfile.lock" }}
paths:
- /home/circleci/.local/share/virtualenvs/flowdb-NgQ6vyXW
- /home/circleci/.local/share/virtualenvs/
- run:
name: Set additional environment variables
command: |
Expand All @@ -194,8 +194,8 @@ jobs:
docker pull flowminder/flowdb:latest && export BUILD_CACHE_TAG=latest || true
docker pull flowminder/flowdb:$SAFE_TAG && export BUILD_CACHE_TAG=$SAFE_TAG || true
echo Using cache from $BUILD_CACHE_TAG
docker build --cache-from flowminder/flowdb:$BUILD_CACHE_TAG --build-arg FLOWDB_VERSION=$FLOWDB_VERSION \
--build-arg FLOWDB_RELEASE_DATE=$FLOWDB_RELEASE_DATE -t flowminder/flowdb:$SAFE_TAG -t flowminder/flowdb:$CIRCLE_SHA1 flowdb
DOCKER_BUILDKIT=1 docker build --cache-from flowminder/flowdb:$BUILD_CACHE_TAG --build-arg FLOWDB_VERSION=$FLOWDB_VERSION \
--build-arg FLOWDB_RELEASE_DATE=$FLOWDB_RELEASE_DATE -t flowminder/flowdb:$SAFE_TAG -t flowminder/flowdb:$CIRCLE_SHA1 -f flowdb.Dockerfile .
- run:
name: Test that not providing a superuser password causes the container to exit
command: |
Expand Down Expand Up @@ -225,9 +225,9 @@ jobs:
- run:
name: Run tests
command: |
cd flowdb
pipenv run pytest --junit-xml=test_results/pytest/results.xml \
--ignore=tests/test_synthetic_data.py --ignore=tests/test_oracle_fdw.py
cd flowdb/tests
pipenv run pytest --junit-xml=../test_results/pytest/results.xml \
--ignore=test_synthetic_data.py --ignore=test_oracle_fdw.py
- store_test_results:
path: flowdb/test_results
- run:
Expand All @@ -246,31 +246,31 @@ jobs:

build_flowdb_oracle:
machine: # Need to talk to the container, so must use machine per: https://circleci.com/docs/2.0/building-docker-images/#accessing-services
image: circleci/classic:201808-01
image: ubuntu-1604:202004-01
environment: *flowdb_env
working_directory: /home/circleci/project/flowdb
working_directory: /home/circleci/project
steps:
- checkout:
path: /home/circleci/project/
- run:
name: "Switch to Python v3.7"
name: "Switch to Python v3.8.2"
command: |
pyenv versions
pyenv global 3.7.0
pyenv global 3.8.2
- run:
name: Install pipenv
command: pip install --upgrade pip pipenv
- restore_cache:
key: flowdb-deps-1-{{ checksum "Pipfile.lock"}}
key: flowdb-deps-1-{{ checksum "flowdb/tests/Pipfile.lock"}}
- attach_workspace:
at: /home/circleci/
- run:
name: Build oracle_fdw image
command: |
echo Building oracle_fdw version $FLOWDB_VERSION
echo Tagging as oracle-$CIRCLE_SHA1
docker build --build-arg ORACLE_BINARY_SOURCE=https://raw.githubusercontent.com/bumpx/oracle-instantclient/master \
--build-arg CODE_VERSION=$CIRCLE_SHA1 -t flowminder/flowdb:oracle-$CIRCLE_SHA1 oracle_fdw
DOCKER_BUILDKIT=1 docker build --build-arg ORACLE_BINARY_SOURCE=https://raw.githubusercontent.com/bumpx/oracle-instantclient/master \
--build-arg CODE_VERSION=$CIRCLE_SHA1 -t flowminder/flowdb:oracle-$CIRCLE_SHA1 -f flowdb_oracle_fdw.Dockerfile .
- run:
name: Launch flowdb
command: |
Expand All @@ -284,8 +284,11 @@ jobs:
- run:
name: Run tests
command: |
pipenv run pytest --junit-xml=test_results/pytest/results.xml \
tests/test_oracle_fdw.py
cd flowdb/tests
pipenv run pytest --junit-xml=../test_results/pytest/results.xml \
test_oracle_fdw.py
- store_test_results:
path: flowdb/test_results
- run:
name: FlowDB-oracle Docker logs
command: docker logs flowdb_oracle
Expand All @@ -294,12 +297,12 @@ jobs:
build_flowdb_testdata:
docker:
- image: circleci/python:3.7
working_directory: /home/circleci/project/flowdb/testdata
working_directory: /home/circleci/project
steps:
- checkout:
path: /home/circleci/project/
- setup_remote_docker:
version: 18.09.3
version: 19.03.8
- attach_workspace:
at: /home/circleci/
- run:
Expand All @@ -310,7 +313,7 @@ jobs:
command: |
echo Building testdata version $FLOWDB_VERSION
echo Tagging as $CIRCLE_SHA1
docker build --build-arg CODE_VERSION=$CIRCLE_SHA1 -t flowminder/flowdb-testdata:$CIRCLE_SHA1 .
DOCKER_BUILDKIT=1 docker build --build-arg CODE_VERSION=$CIRCLE_SHA1 -t flowminder/flowdb-testdata:$CIRCLE_SHA1 -f flowdb_testdata.Dockerfile .
- run:
name: Push images to Docker cloud
command: |
Expand All @@ -319,12 +322,12 @@ jobs:
build_flowdb_synthdata:
docker:
- image: circleci/python:3.7
working_directory: /home/circleci/project/flowdb/testdata
working_directory: /home/circleci/project
steps:
- checkout:
path: /home/circleci/project/
- setup_remote_docker:
version: 18.09.3
version: 19.03.8
- attach_workspace:
at: /home/circleci/
- run:
Expand All @@ -335,8 +338,8 @@ jobs:
command: |
echo Building flowdb-synthetic-data version $FLOWDB_VERSION
echo Tagging as $CIRCLE_SHA1
docker build --build-arg CODE_VERSION=$CIRCLE_SHA1 -t flowminder/flowdb-synthetic-data:$CIRCLE_SHA1 \
-f Dockerfile.synthetic_data .
DOCKER_BUILDKIT=1 docker build --build-arg CODE_VERSION=$CIRCLE_SHA1 -t flowminder/flowdb-synthetic-data:$CIRCLE_SHA1 \
-f flowdb_synthetic_data.Dockerfile .
- run:
name: Test that a data generator must be set for synth data
command: |
Expand Down Expand Up @@ -444,8 +447,8 @@ jobs:
name: python_with_flowdb
flowdb_image: "synthetic-data"
synthetic_data_generator: <<parameters.synthetic_data_generator>>
python_version: "3.7"
working_directory: /home/circleci/project/flowdb
python_version: "3.8"
working_directory: /home/circleci/project/flowdb/tests
steps:
- checkout:
path: /home/circleci/project/
Expand All @@ -455,7 +458,7 @@ jobs:
- run: *wait_for_flowdb
- run:
name: Run tests
command: pipenv run pytest --junit-xml=test_results/pytest/results.xml tests/test_synthetic_data.py
command: pipenv run pytest --junit-xml=../../test_results/pytest/results.xml test_synthetic_data.py
- store_test_results:
path: test_results

Expand Down Expand Up @@ -641,16 +644,15 @@ jobs:
["flowmachine", "flowauth", "flowapi", "flowkit-examples", "flowetl", "autoflow"]
component_path:
type: string
docker:
- image: circleci/python:3.7
machine:
image: ubuntu-1604:202004-01
working_directory: /home/circleci/project/
steps:
- checkout:
path: /home/circleci/project/
- attach_workspace:
at: /home/circleci
- setup_remote_docker:
version: 18.09.3
- run: sudo apt update && sudo apt install docker-ce
- run:
name: Log in to docker cloud
command: docker login --username $DOCKER_CLOUD_USER --password $DOCKER_CLOUD_PASSWORD
Expand All @@ -659,7 +661,7 @@ jobs:
command: |
echo "Tagging as $CIRCLE_SHA1"
export SOURCE_VERSION=$(git describe --tags --dirty --always | sed s/"-"/"+"/ | sed s/"-"/"."/g)
docker build --build-arg SOURCE_VERSION=$SOURCE_VERSION -t flowminder/<<parameters.component>>:$CIRCLE_SHA1 <<parameters.component_path>>
DOCKER_BUILDKIT=1 docker build --build-arg SOURCE_VERSION=$SOURCE_VERSION -t flowminder/<<parameters.component>>:$CIRCLE_SHA1 -f <<parameters.component_path>>.Dockerfile .
- run:
name: Push images to Docker cloud
command: |
Expand Down Expand Up @@ -709,7 +711,9 @@ jobs:
key: flowetl-deps-1-{{ checksum "Pipfile.lock"}}
- run:
name: Set python version
command: pyenv global 3.7.0
command: |
pyenv versions
pyenv global 3.7.0
- run:
name: Install pipenv
command: pip install --upgrade pip pipenv
Expand Down Expand Up @@ -1021,7 +1025,7 @@ workflows:
- build_docker_image:
name: build_examples
component: flowkit-examples
component_path: .
component_path: examples
<<: *run_always_org_context
- build_docker_image:
name: build_flowetl
Expand Down
3 changes: 1 addition & 2 deletions autoflow/Dockerfile → autoflow.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM python:3.8-slim
ARG SOURCE_VERSION=0+unknown
ENV SOURCE_VERSION=${SOURCE_VERSION}
ENV SOURCE_TREE=FlowKit-${SOURCE_VERSION}
COPY . /${SOURCE_TREE}/autoflow/
COPY . /${SOURCE_TREE}/

ENV AUTOFLOW_DB_URI="sqlite:////tmp/test.db"
ENV AUTOFLOW_INPUTS_DIR=/mounts/inputs
Expand All @@ -12,7 +12,6 @@ ENV PREFECT__USER_CONFIG_PATH=/${SOURCE_TREE}/autoflow/config/config.toml
ENV PREFECT__ASCIIDOC_TEMPLATE_PATH=/${SOURCE_TREE}/autoflow/config/asciidoc_extended.tpl

WORKDIR /${SOURCE_TREE}/autoflow

RUN apt-get update -yqq \
&& apt-get upgrade -yqq \
&& apt-get upgrade -yqq git \
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions deployment/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions docker-compose-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,42 @@ services:
flowdb:
image: flowminder/flowdb:${CONTAINER_TAG:-latest}
build:
context: ./flowdb/
dockerfile: Dockerfile
context: .
dockerfile: flowdb.Dockerfile

flowmachine:
image: flowminder/flowmachine:${CONTAINER_TAG:-latest}
build:
context: ./flowmachine
dockerfile: Dockerfile
context: .
dockerfile: flowmachine.Dockerfile

worked_examples:
container_name: worked_examples
image: flowminder/flowkit-examples:${CONTAINER_TAG:-latest}
build:
context: .
dockerfile: Dockerfile
dockerfile: examples.Dockerfile

flowapi:
image: flowminder/flowapi:${CONTAINER_TAG:-latest}
build:
context: ./flowapi
dockerfile: Dockerfile
context: .
dockerfile: flowapi.Dockerfile

flowauth:
image: flowminder/flowauth:${CONTAINER_TAG:-latest}
build:
context: ./flowauth
dockerfile: Dockerfile
context: .
dockerfile: flowauth.Dockerfile

flowetl:
image: flowminder/flowetl:${CONTAINER_TAG:-latest}
build:
context: ./flowetl
dockerfile: Dockerfile
context: .
dockerfile: flowetl.Dockerfile

autoflow:
image: flowminder/autoflow:${CONTAINER_TAG:-latest}
build:
context: ./autoflow
dockerfile: Dockerfile
context: .
dockerfile: autoflow.Dockerfile
4 changes: 2 additions & 2 deletions docker-compose-syntheticdata-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ services:
flowdb:
image: flowminder/flowdb-synthetic-data:${CONTAINER_TAG:-latest}
build:
context: ./flowdb/testdata/
dockerfile: Dockerfile.synthetic_data
context: .
dockerfile: flowdb_synthetic_data.Dockerfile
4 changes: 2 additions & 2 deletions docker-compose-testdata-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ services:
flowdb:
image: flowminder/flowdb-testdata:${CONTAINER_TAG:-latest}
build:
context: ./flowdb/testdata/
dockerfile: Dockerfile
context: .
dockerfile: flowdb_testdata.Dockerfile
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions flowapi/Dockerfile → flowapi.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ ARG SOURCE_VERSION=0+unknown
ENV SOURCE_VERSION=${SOURCE_VERSION}
ENV SOURCE_TREE=FlowKit-${SOURCE_VERSION}
WORKDIR /${SOURCE_TREE}/flowapi
COPY Pipfile* ./
COPY ./flowapi/Pipfile* ./
RUN apk update && apk add libzmq && apk add --virtual build-dependencies build-base libffi-dev \
gcc wget git musl-dev zeromq-dev openssl-dev && \
pip install --no-cache-dir pipenv Cython && pipenv install --clear --deploy && \
apk del build-dependencies
COPY . /${SOURCE_TREE}/flowapi/
COPY . /${SOURCE_TREE}/
RUN pipenv run python setup.py install
ENV QUART_ENV=production
CMD ["pipenv", "run", "./start.sh"]
Loading