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

Add s3fs, seaborn #545

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions build_artifacts/v2/v2.3/v2.3.0/cpu.additional_packages_env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
conda-forge::s3fs
conda-forge::seaborn
2 changes: 2 additions & 0 deletions build_artifacts/v2/v2.3/v2.3.0/gpu.additional_packages_env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
conda-forge::s3fs
conda-forge::seaborn
10 changes: 10 additions & 0 deletions test/test_artifacts/v2/s3fs.test.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ARG SAGEMAKER_DISTRIBUTION_IMAGE
FROM $SAGEMAKER_DISTRIBUTION_IMAGE

ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN git clone --recursive https://github.com/fsspec/s3fs.git

WORKDIR "s3fs"
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_s3fs_tests.sh .
RUN chmod +x run_s3fs_tests.sh
CMD ["./run_s3fs_tests.sh"]
19 changes: 19 additions & 0 deletions test/test_artifacts/v2/scripts/run_s3fs_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# We need to checkout the version of s3fs that is installed in the mamba environment.
s3fs_version=$(micromamba list | grep s3fs | tr -s ' ' | cut -d ' ' -f 3)
# Checkout the corresponding s3fs source code
git checkout tags/$s3fs_version

# Install requirements
# Remove portion incompatible with conda/mamba
sed -i "s/; python_version < '3.3'//" test_requirements.txt
# For <2024.12.0, there's no upperbound on moto.
# This causes test failures, so we add the upperbound.
# https://github.com/fsspec/s3fs/pull/917/files#diff-25d7875059b9486b7912948b78c0bb1c763d565fe0d12dc8287b5f0dc9982176L17
if [[ "$s3fs_version" == "2024.10.0" ]]; then
sed -i "s/moto>=4/moto>=4,<5/" test_requirements.txt
fi
micromamba install --freeze-installed -y --file test_requirements.txt

pytest || exit $?
18 changes: 18 additions & 0 deletions test/test_artifacts/v2/scripts/run_seaborn_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# We need to checkout the version of seaborn that is installed in the mamba environment.
seaborn_version=$(micromamba list | grep seaborn-base | tr -s ' ' | cut -d ' ' -f 3)
# Checkout the corresponding seaborn source code
git checkout tags/v$seaborn_version

# There's a test issue that was fixed for 0.13.2 release but isn't in the tag
# https://github.com/mwaskom/seaborn/pull/3802
# Cherry pick works but fails to commit due to no git creds, for our test we can ignore the error.
if [[ "$seaborn_version" == "0.13.2" ]]; then
git cherry-pick 385e54676ca16d0132434bc9df6bc41ea8b2a0d4 || true
fi

# Install test dependencies
micromamba install --freeze-installed -y pytest pytest-cov pytest-xdist pandas-stubs

pytest || exit $?
10 changes: 10 additions & 0 deletions test/test_artifacts/v2/seaborn.test.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ARG SAGEMAKER_DISTRIBUTION_IMAGE
FROM $SAGEMAKER_DISTRIBUTION_IMAGE

ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN git clone --recursive https://github.com/mwaskom/seaborn.git

WORKDIR "seaborn"
COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_seaborn_tests.sh .
RUN chmod +x run_seaborn_tests.sh
CMD ["./run_seaborn_tests.sh"]
4 changes: 4 additions & 0 deletions test/test_dockerfile_based_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
("mlflow.test.Dockerfile", ["mlflow"]),
("jupyter-activity-monitor-extension.test.Dockerfile", ["jupyter-activity-monitor-extension"]),
("docker-cli.test.Dockerfile", ["docker-cli"]),
("s3fs.test.Dockerfile", ["s3fs"]),
("seaborn.test.Dockerfile", ["seaborn"]),
],
)
def test_dockerfiles_for_cpu(
Expand Down Expand Up @@ -93,6 +95,8 @@ def test_dockerfiles_for_cpu(
("jupyter-activity-monitor-extension.test.Dockerfile", ["jupyter-activity-monitor-extension"]),
("gpu-dependencies.test.Dockerfile", ["pytorch", "tensorflow"]),
("docker-cli.test.Dockerfile", ["docker-cli"]),
("s3fs.test.Dockerfile", ["s3fs"]),
("seaborn.test.Dockerfile", ["seaborn"]),
],
)
def test_dockerfiles_for_gpu(
Expand Down
Loading