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 docker cli to SMD #498

Open
wants to merge 1 commit into
base: release-2.1.0
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.1/v2.1.0/cpu.additional_packages_env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Add any additional packages here
conda-forge::docker-cli[version='>=27.1.1']
2 changes: 2 additions & 0 deletions build_artifacts/v2/v2.1/v2.1.0/gpu.additional_packages_env.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Add any additional packages here
conda-forge::docker-cli[version='>=27.1.1']
9 changes: 9 additions & 0 deletions test/test_artifacts/v2/docker-cli.test.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ARG SAGEMAKER_DISTRIBUTION_IMAGE
FROM $SAGEMAKER_DISTRIBUTION_IMAGE

ARG MAMBA_DOCKERFILE_ACTIVATE=1

COPY --chown=$MAMBA_USER:$MAMBA_USER scripts/run_docker_cli_tests.sh ./
RUN chmod +x run_docker_cli_tests.sh

CMD ["./run_docker_cli_tests.sh"]
24 changes: 24 additions & 0 deletions test/test_artifacts/v2/scripts/run_docker_cli_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# Function to check if Docker CLI is installed
function check_docker_installed {
if ! command -v docker &> /dev/null; then
echo "Docker CLI is not installed."
exit 1
else
echo "Docker CLI is installed."
fi
}
# Function to validate Docker can execute basic commands
function check_docker_functionality {
# Try running a simple Docker command
if docker --version &> /dev/null; then
echo "Docker CLI is functioning correctly."
else
echo "Docker CLI is not functioning correctly."
exit 1
fi
}
# Run the checks
check_docker_installed
check_docker_functionality
echo "Docker CLI validation successful."
2 changes: 2 additions & 0 deletions test/test_dockerfile_based_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
("langchain-aws.test.Dockerfile", ["langchain-aws"]),
("mlflow.test.Dockerfile", ["mlflow"]),
("jupyter-activity-monitor-extension.test.Dockerfile", ["jupyter-activity-monitor-extension"]),
("docker-cli.test.Dockerfile", ["docker-cli"]),
],
)
def test_dockerfiles_for_cpu(
Expand Down Expand Up @@ -91,6 +92,7 @@ def test_dockerfiles_for_cpu(
("sagemaker-mlflow.test.Dockerfile", ["sagemaker-mlflow"]),
("jupyter-activity-monitor-extension.test.Dockerfile", ["jupyter-activity-monitor-extension"]),
("gpu-dependencies.test.Dockerfile", ["pytorch", "tensorflow"]),
("docker-cli.test.Dockerfile", ["docker-cli"]),
],
)
def test_dockerfiles_for_gpu(
Expand Down