Skip to content

Commit

Permalink
chore: fix docker-based testing scripts for docker-25 (#337)
Browse files Browse the repository at this point in the history
Summary:
This fixes a couple of issues with our scripting:
1. The existing Dockerfiles do not work with Docker 25; they were
   written for Docker 20. The behavior of the VOLUME directive has
   changed to no longer automatically create the directories listed.
2. create_service_resources.sh was using an incorrect name for a request
   parameter; the name was changed in the run-up to GA.
3. The scripts could no longer be used with model & endpoint overrides for
   the deadline service. This functionality broke with GA and the
   inclusion of the model in boto3.

Signed-off-by: Daniel Neilson <53624638+ddneilson@users.noreply.github.com>
  • Loading branch information
ddneilson authored Jun 20, 2024
1 parent bcac41e commit 4ddb07b
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion scripts/create_service_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ then
"configuration": {
"customerManaged": {
"mode": "NO_SCALING",
"workerRequirements": {
"workerCapabilities": {
"vCpuCount": {
"min": 1
},
Expand Down
4 changes: 4 additions & 0 deletions scripts/run_posix_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ if test "${PIP_INDEX_URL:-}" != ""; then
echo "PIP_INDEX_URL=${PIP_INDEX_URL}" >> $TMP_ENV_FILE
fi

if test "${AWS_ENDPOINT_URL_DEADLINE}" != ""; then
echo "AWS_ENDPOINT_URL_DEADLINE=${AWS_ENDPOINT_URL_DEADLINE}" >> $TMP_ENV_FILE
fi

docker run --rm \
--name test_worker_agent \
-v $(pwd):/code:ro \
Expand Down
8 changes: 4 additions & 4 deletions testing_containers/posix_ldap_multiuser/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ ENV AGENT_USER=agentuser
ENV JOB_USER=jobuser
ENV SHARED_GROUP=sharedgroup

# Use a docker volume to mount the root of the repo to this directory
VOLUME /code /aws

WORKDIR /config

COPY changePassword.ldif /config
Expand All @@ -27,7 +24,8 @@ COPY term_agent.sh /config
# These accounts belong to the following groups:
# agentuser: agentuser, sharedgroup
# jobuser: jobuser, sharedgroup
RUN chmod 777 /code /aws && \
RUN mkdir /code /aws && \
chmod 777 /code /aws && \
echo $(grep $(hostname) /etc/hosts | cut -f1) ldap.environment.internal >> /etc/hosts && \
apt-get update && export DEBIAN_FRONTEND=noninteractive && \
apt-get install -y vim screen slapd ldap-utils && \
Expand Down Expand Up @@ -65,6 +63,8 @@ RUN chmod 777 /code /aws && \
apt-get install sudo-ldap && \
echo "${AGENT_USER} ALL=(${JOB_USER},${AGENT_USER}) NOPASSWD: ALL" > /etc/sudoers.d/${AGENT_USER}

# Use a docker volume to mount the root of the repo to this directory
VOLUME /code /aws

WORKDIR /home/agentuser

Expand Down
2 changes: 2 additions & 0 deletions testing_containers/posix_ldap_multiuser/run_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ python -m venv .venv
source .venv/bin/activate
pip install /code/dist/deadline_cloud_worker_agent-*-py3-none-any.whl

ln -s /aws ~/.aws

deadline-worker-agent \
--posix-job-user jobuser:sharedgroup \
--no-shutdown \
Expand Down
9 changes: 5 additions & 4 deletions testing_containers/posix_local_multiuser/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ ENV AGENT_USER=agentuser
ENV JOB_USER=jobuser
ENV SHARED_GROUP=sharedgroup

# Use a docker volume to mount the root of the repo to this directory
VOLUME /code /aws

# We set up two users:
# 1) agentuser -- the user that will be running the Worker Agent.
# 2) jobuser -- the user that we'll be running Jobs as.
Expand All @@ -17,7 +14,8 @@ VOLUME /code /aws
# agentuser: agentuser, sharedgroup
# jobuser: jobuser, sharedgroup

RUN chmod 777 /code /aws && \
RUN mkdir /code /aws && \
chmod 777 /code /aws && \
apt-get update && apt-get install sudo && \
rm -rf /var/lib/apt/lists/* && \
addgroup ${SHARED_GROUP} && \
Expand All @@ -37,6 +35,9 @@ RUN chmod 777 /code /aws && \
chown ${AGENT_USER}:${SHARED_GROUP} /var/lib/deadline /var/lib/deadline/queues && \
chmod 750 /var/lib/deadline /var/lib/deadline/queues

# Use a docker volume to mount the root of the repo to this directory
VOLUME /code /aws

WORKDIR /home/agentuser

COPY --chown=agentuser:agentuser run_agent.sh /home/agentuser/
Expand Down
2 changes: 2 additions & 0 deletions testing_containers/posix_local_multiuser/run_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ python -m venv .venv
source .venv/bin/activate
pip install /code/dist/deadline_cloud_worker_agent-*-py3-none-any.whl

ln -s /aws ~/.aws

deadline-worker-agent \
--posix-job-user jobuser:sharedgroup \
--no-shutdown \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ ENV AGENT_USER=agentuser
ENV JOB_USER=jobuser
ENV SHARED_GROUP=sharedgroup

# Use a docker volume to mount the root of the repo to this directory
VOLUME /code /aws

# We set up two users:
# 1) agentuser -- the user that will be running the Worker Agent.
# 2) jobuser -- the user that we'll be running Jobs as.
Expand All @@ -17,7 +14,8 @@ VOLUME /code /aws
# agentuser: agentuser, sharedgroup
# jobuser: jobuser, sharedgroup

RUN chmod 777 /code /aws && \
RUN mkdir /code /aws && \
chmod 777 /code /aws && \
apt-get update && apt-get install sudo && \
rm -rf /var/lib/apt/lists/* && \
addgroup ${SHARED_GROUP} && \
Expand All @@ -37,6 +35,9 @@ RUN chmod 777 /code /aws && \
chown ${AGENT_USER}:${SHARED_GROUP} /var/lib/deadline /var/lib/deadline/queues && \
chmod 750 /var/lib/deadline /var/lib/deadline/queues

# Use a docker volume to mount the root of the repo to this directory
VOLUME /code /aws

WORKDIR /home/agentuser

COPY --chown=agentuser:agentuser run_agent.sh /home/agentuser/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ python -m venv .venv
source .venv/bin/activate
pip install /code/dist/deadline_cloud_worker_agent-*-py3-none-any.whl

ln -s /aws ~/.aws

deadline-worker-agent \
--no-shutdown \
--farm-id $FARM_ID \
Expand Down

0 comments on commit 4ddb07b

Please sign in to comment.