diff --git a/.github/workflows/build_container.yml b/.github/workflows/build_container.yml new file mode 100644 index 0000000..6a9fc82 --- /dev/null +++ b/.github/workflows/build_container.yml @@ -0,0 +1,22 @@ +name: Container build + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Build container + run: | + make + + diff --git a/Makefile b/Makefile index f7cfc9a..f254253 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ SHELL := /bin/sh # Set variables if testing locally ifeq ($(IS_RELEASE_BUILD),) - SPARK_VERSION := 3.0 + SPARK_VERSION := 3.1 PROCESSOR := cpu FRAMEWORK_VERSION := py37 SM_VERSION := 1.0 @@ -34,12 +34,14 @@ init: pip install pipenv --upgrade pipenv run pip install --upgrade pip pipenv install - cp {Pipfile,Pipfile.lock,setup.py} ${BUILD_CONTEXT} + cp Pipfile ${BUILD_CONTEXT} + cp Pipfile.lock ${BUILD_CONTEXT} + cp setup.py ${BUILD_CONTEXT} # Builds and moves container python library into the Docker build context build-container-library: init python setup.py bdist_wheel; - cp dist/*.whl ${BUILD_CONTEXT} + cp -- dist/*.whl ${BUILD_CONTEXT} install-container-library: init pipenv run safety check # https://github.com/pyupio/safety @@ -49,7 +51,7 @@ build-static-config: --processor ${PROCESSOR} --framework-version ${FRAMEWORK_VERSION} --sm-version ${SM_VERSION} # Builds docker image. -build: build-container-library build-static-config +build: build-container-library ./scripts/build.sh --region ${REGION} --use-case ${USE_CASE} --spark-version ${SPARK_VERSION} \ --processor ${PROCESSOR} --framework-version ${FRAMEWORK_VERSION} --sm-version ${SM_VERSION} @@ -147,4 +149,4 @@ release: # Targets that don't create a file with the same name as the target. -.PHONY: all build test test-all clean clean-all release whitelist build-container-library \ No newline at end of file +.PHONY: all build test test-all clean clean-all release whitelist build-container-library diff --git a/scripts/build.sh b/scripts/build.sh index 9e915e1..6595df2 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -22,7 +22,7 @@ source scripts/shared.sh parse_std_args "$@" -aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 137112412989.dkr.ecr.us-west-2.amazonaws.com +#aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 137112412989.dkr.ecr.us-west-2.amazonaws.com echo "building image ${version} ... " docker build \ @@ -32,4 +32,4 @@ docker build \ -t sagemaker-spark:latest \ ${build_context} -docker logout https://137112412989.dkr.ecr.us-west-2.amazonaws.com +#docker logout https://137112412989.dkr.ecr.us-west-2.amazonaws.com