Skip to content

Commit 04b5676

Browse files
authored
1. Pin deps using Pipfile (#55)
2. Change spark.rpc.askTimeout to 300(default 120) 3. Change dfs.client.block.write.replace-datanode-on-failure.policy to ALWAYS 4. Add integ test with 1 instance 5. Remove python37-sagemaker-pyspark 6. upgrade cryptography to 3.3.2
1 parent 2973e62 commit 04b5676

File tree

15 files changed

+473
-242
lines changed

15 files changed

+473
-242
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,8 @@ aws-config/
5656

5757
# FIXME: remove this once we're consuming EMR packages through build
5858
emr-spark-packages
59+
60+
# Pipe and .whl files used to build the container
61+
spark/processing/*/*/Pipfile*
62+
spark/processing/*/*/smspark*
63+
spark/processing/*/*/setup.py

Makefile

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ all: build test
3030

3131
# Downloads EMR packages. Skips if the tar file containing EMR packages has been made.
3232

33-
# Builds and moves container python library into the Docker build context
34-
build-container-library:
35-
python setup.py bdist_wheel;
36-
cp dist/*.whl ${BUILD_CONTEXT}
37-
3833
init:
3934
pip install pipenv --upgrade
4035
pipenv install
36+
cp {Pipfile,Pipfile.lock,setup.py} ${BUILD_CONTEXT}
37+
38+
# Builds and moves container python library into the Docker build context
39+
build-container-library: init
40+
python setup.py bdist_wheel;
41+
cp dist/*.whl ${BUILD_CONTEXT}
4142

42-
install-container-library: init build-container-library
43-
pip install --upgrade dist/smspark-0.1-py3-none-any.whl
44-
safety check # https://github.com/pyupio/safety
43+
install-container-library: init
44+
pipenv run safety check # https://github.com/pyupio/safety
4545

4646
build-static-config:
4747
./scripts/fetch-ec2-instance-type-info.sh --region ${REGION} --use-case ${USE_CASE} --spark-version ${SPARK_VERSION} \
@@ -64,25 +64,25 @@ build-test-java:
6464

6565
build-tests: build-test-scala build-test-java
6666

67-
lint:
68-
black --check ./src
69-
black --check ./test
70-
mypy --follow-imports=skip src/smspark # see mypy.ini for configuration
71-
flake8 src # see .flake8 for configuration
67+
lint: init
68+
pipenv run black --check ./src
69+
pipenv run black --check ./test
70+
pipenv run mypy --follow-imports=skip src/smspark # see mypy.ini for configuration
71+
pipenv run flake8 src # see .flake8 for configuration
7272

73-
test-unit: build-container-library install-container-library
74-
python -m pytest -s -vv test/unit
73+
test-unit: install-container-library
74+
pipenv run python -m pytest -s -vv test/unit
7575

7676
# Only runs local tests.
77-
test-local: install-sdk build-tests
78-
python -m pytest -s -vv test/integration/local --repo=$(DEST_REPO) --tag=$(VERSION) --role=$(ROLE) --durations=0
77+
test-local: install-container-library build-tests
78+
pipenv run python -m pytest -s -vv test/integration/local --repo=$(DEST_REPO) --tag=$(VERSION) --role=$(ROLE) --durations=0
7979

8080
# Only runs sagemaker tests
8181
# Use pytest-parallel to run tests in parallel - https://pypi.org/project/pytest-parallel/
82-
test-sagemaker: install-sdk build-tests
82+
test-sagemaker: build-tests
8383
# Separate `pytest` invocation without parallelization:
8484
# History server tests can't run in parallel since they use the same container name.
85-
pytest -s -vv test/integration/history \
85+
pipenv run pytest -s -vv test/integration/history \
8686
--repo=$(DEST_REPO) --tag=$(VERSION) --durations=0 \
8787
--spark-version=$(SPARK_VERSION) \
8888
--framework-version=$(FRAMEWORK_VERSION) \
@@ -91,7 +91,7 @@ test-sagemaker: install-sdk build-tests
9191
--region ${REGION} \
9292
--domain ${AWS_DOMAIN}
9393
# OBJC_DISABLE_INITIALIZE_FORK_SAFETY: https://github.com/ansible/ansible/issues/32499#issuecomment-341578864
94-
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES pytest --workers auto -s -vv test/integration/sagemaker \
94+
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES pipenv run pytest --workers auto -s -vv test/integration/sagemaker \
9595
--repo=$(DEST_REPO) --tag=$(VERSION) --durations=0 \
9696
--spark-version=$(SPARK_VERSION) \
9797
--framework-version=$(FRAMEWORK_VERSION) \
@@ -103,7 +103,7 @@ test-sagemaker: install-sdk build-tests
103103

104104
# This is included in a separate target because it will be run only in prod stage
105105
test-prod:
106-
pytest -s -vv test/integration/tag \
106+
pipenv run pytest -s -vv test/integration/tag \
107107
--repo=$(DEST_REPO) --tag=$(VERSION) --durations=0 \
108108
--spark-version=$(SPARK_VERSION) \
109109
--framework-version=$(FRAMEWORK_VERSION) \
@@ -128,6 +128,7 @@ clean:
128128
rm ${BUILD_CONTEXT}/*.whl || true
129129
rm -rf dist || true
130130
rm -rf build || true
131+
rm =2.9.0
131132

132133
# Removes compiled Scala SBT artifacts
133134
clean-test-scala:
@@ -145,4 +146,4 @@ release:
145146

146147

147148
# Targets that don't create a file with the same name as the target.
148-
.PHONY: all build test test-all install-sdk clean clean-all release whitelist build-container-library
149+
.PHONY: all build test test-all clean clean-all release whitelist build-container-library

Pipfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ waitress = "==1.4.4"
1414
requests = "==2.24.0"
1515
rsa = "==4.3"
1616
pyasn1 = "==0.4.8"
17-
boto3 = "==1.14.58"
17+
boto3 = "==1.17.14"
1818
safety = "==1.9.0"
1919
black = "==19.10b0"
2020
mypy = "==0.782"
@@ -26,6 +26,11 @@ pytest-xdist = "==1.32.0"
2626
docker = "==4.2.2"
2727
docker-compose = "==1.26.2"
2828
cryptography = "==3.3.2"
29+
typing-extensions = "==3.7.4.3"
30+
sagemaker = "==2.30.0"
31+
smspark = {editable = true, path = "."}
32+
importlib-metadata = "==3.7.3"
33+
pytest-parallel = "==0.1.0"
2934

3035
[requires]
3136
python_version = "3.7"

0 commit comments

Comments
 (0)