Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
@@ -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


12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}

Expand Down Expand Up @@ -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
.PHONY: all build test test-all clean clean-all release whitelist build-container-library
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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