From e185174e1c395bc699ce8f2b99cebc8676904717 Mon Sep 17 00:00:00 2001 From: Clayton Parnell Date: Thu, 8 Aug 2024 09:49:56 -0700 Subject: [PATCH] fix: Minor test fixes --- .../v1/amazon-q-developer-jupyterlab-ext.test.Dockerfile | 6 ++++++ ...mazon-sagemaker-jupyter-ai-q-developer.test.Dockerfile | 6 ++++++ test/test_artifacts/v1/gpu-dependencies.test.Dockerfile | 2 +- .../v1/jupyter-activity-monitor-extension.test.Dockerfile | 8 ++++++++ test/test_artifacts/v1/pytorch.examples.Dockerfile | 5 ----- 5 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 test/test_artifacts/v1/amazon-q-developer-jupyterlab-ext.test.Dockerfile create mode 100644 test/test_artifacts/v1/amazon-sagemaker-jupyter-ai-q-developer.test.Dockerfile create mode 100644 test/test_artifacts/v1/jupyter-activity-monitor-extension.test.Dockerfile diff --git a/test/test_artifacts/v1/amazon-q-developer-jupyterlab-ext.test.Dockerfile b/test/test_artifacts/v1/amazon-q-developer-jupyterlab-ext.test.Dockerfile new file mode 100644 index 00000000..02599032 --- /dev/null +++ b/test/test_artifacts/v1/amazon-q-developer-jupyterlab-ext.test.Dockerfile @@ -0,0 +1,6 @@ +ARG SAGEMAKER_DISTRIBUTION_IMAGE +FROM $SAGEMAKER_DISTRIBUTION_IMAGE + +ARG MAMBA_DOCKERFILE_ACTIVATE=1 + +CMD ["python", "-c", "import amazon_q_developer_jupyterlab_ext"] diff --git a/test/test_artifacts/v1/amazon-sagemaker-jupyter-ai-q-developer.test.Dockerfile b/test/test_artifacts/v1/amazon-sagemaker-jupyter-ai-q-developer.test.Dockerfile new file mode 100644 index 00000000..4c9ec976 --- /dev/null +++ b/test/test_artifacts/v1/amazon-sagemaker-jupyter-ai-q-developer.test.Dockerfile @@ -0,0 +1,6 @@ +ARG SAGEMAKER_DISTRIBUTION_IMAGE +FROM $SAGEMAKER_DISTRIBUTION_IMAGE + +ARG MAMBA_DOCKERFILE_ACTIVATE=1 + +CMD ["python", "-c", "import amazon_sagemaker_jupyter_ai_q_developer"] diff --git a/test/test_artifacts/v1/gpu-dependencies.test.Dockerfile b/test/test_artifacts/v1/gpu-dependencies.test.Dockerfile index 2e48e09d..40091702 100644 --- a/test/test_artifacts/v1/gpu-dependencies.test.Dockerfile +++ b/test/test_artifacts/v1/gpu-dependencies.test.Dockerfile @@ -8,4 +8,4 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1 # 2. Check if Pytorch is installed with CUDA support for GPU image COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/cuda_validation.py . RUN chmod +x cuda_validation.py -RUN python3 cuda_validation.py \ No newline at end of file +CMD python3 cuda_validation.py diff --git a/test/test_artifacts/v1/jupyter-activity-monitor-extension.test.Dockerfile b/test/test_artifacts/v1/jupyter-activity-monitor-extension.test.Dockerfile new file mode 100644 index 00000000..fa108d52 --- /dev/null +++ b/test/test_artifacts/v1/jupyter-activity-monitor-extension.test.Dockerfile @@ -0,0 +1,8 @@ +ARG SAGEMAKER_DISTRIBUTION_IMAGE +FROM $SAGEMAKER_DISTRIBUTION_IMAGE + +ARG MAMBA_DOCKERFILE_ACTIVATE=1 +RUN micromamba install pytest --freeze-installed --yes --channel conda-forge --name base +RUN micromamba install pytest-jupyter --freeze-installed --yes --channel conda-forge --name base +RUN SITE_PACKAGES=$(pip show jupyter-activity-monitor-extension | grep Location | awk '{print $2}') && \ + cd "$SITE_PACKAGES/jupyter_activity_monitor_extension/tests/" && pytest -p pytest_jupyter.jupyter_server diff --git a/test/test_artifacts/v1/pytorch.examples.Dockerfile b/test/test_artifacts/v1/pytorch.examples.Dockerfile index f2c3231a..ed8f4c5b 100644 --- a/test/test_artifacts/v1/pytorch.examples.Dockerfile +++ b/test/test_artifacts/v1/pytorch.examples.Dockerfile @@ -10,11 +10,6 @@ RUN sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.1 /usr/lib/x86_64-linux-gnu/ WORKDIR "examples" -# There is a line in run_python_examples.sh which looks like: BASE_DIR=`pwd`"/"`dirname $0` -# When we run the shell script through /usr/local/bin/_entrypoint.sh, that line above doesn't work correctly. In our -# case, we properly set `pwd` to the directory that contains all the examples, so we just modify the script to change -# the previous line to look like: BASE_DIR=`pwd` -RUN sed -i 's/^BASE_DIR=.*pwd.*dirname.*/BASE_DIR=`pwd`/' run_python_examples.sh RUN ./run_python_examples.sh install_deps # We skip `imagenet` because it requires a lot of resources and so aren't a good fit for us.