Skip to content

Commit 6aea0b1

Browse files
malfetpytorchmergebot
authored andcommitted
[CI] Make install_user.sh compatible with Focal (pytorch#77622)
By adding explicit `/etc/shadow` entry Also, add test that it works, by running `sudo -v` as user `jenkins` Pull Request resolved: pytorch#77622 Approved by: https://github.com/kit1980
1 parent 668599a commit 6aea0b1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.circleci/docker/common/install_user.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set -ex
66
# jenkins user as ec2-user should have the same user-id
77
echo "jenkins:x:1000:1000::/var/lib/jenkins:" >> /etc/passwd
88
echo "jenkins:x:1000:" >> /etc/group
9+
# Needed on focal or newer
10+
echo "jenkins:*:19110:0:99999:7:::" >>/etc/shadow
911

1012
# Create $HOME
1113
mkdir -p /var/lib/jenkins
@@ -19,3 +21,6 @@ chown jenkins:jenkins /usr/local
1921
# Allow sudo
2022
# TODO: Maybe we shouldn't
2123
echo 'jenkins ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/jenkins
24+
25+
# Test that sudo works
26+
sudo -u jenkins sudo -v

.github/workflows/docker-builds.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
- docker-image-name: pytorch-linux-xenial-py3-clang7-onnx
3939
- docker-image-name: pytorch-linux-xenial-py3.7-gcc5.4
4040
- docker-image-name: pytorch-linux-xenial-py3.7-gcc7
41+
- docker-image-name: pytorch-linux-focal-py3.7-gcc7
4142
env:
4243
DOCKER_IMAGE_BASE: 308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/${{ matrix.docker-image-name }}
4344
steps:

0 commit comments

Comments
 (0)