Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 6194edb

Browse files
xwu2gitxx yy
andauthored
remove sudo in build scripts (#486)
* remove sudo in build scripts except in QAT * remove sudo in qatbuild.sh Co-authored-by: xx yy <[email protected]>
1 parent 1f9e345 commit 6194edb

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,6 @@ build.sh:
142142
```bash
143143
for dep in .2 .1; do
144144
image=$(grep -m1 '#' "Dockerfile$dep" | cut -d' ' -f2)
145-
sudo docker build --network=host --file="Dockerfile$dep" -t "$image:latest" . $(env | grep -E '_(proxy)=' | sed 's/^/--build-arg /')
145+
docker build --network=host --file="Dockerfile$dep" -t "$image:latest" . $(env | grep -E '_(proxy)=' | sed 's/^/--build-arg /')
146146
done
147147
```

VCA2/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ See the following documents for instructions on how to setup Intel VCA 2:
66

77
The Dockerfiles presented in this repo are targeted to run on the Intel VCA 2 nodes. Therefore the host installation steps mentioned in the parent [README.md](../README.md) apply to each Intel VCA 2 node instead.
88

9-
The build and test scripts additionally require "sudo" to be available on the node:
10-
11-
```sh
12-
Ubuntu: apt-get install -y sudo
13-
CentOS: yum install -y sudo
14-
```
15-
169
### GPU Dockers:
1710

1811
VAAPI expects rendering device to be set in order to work. Dockers readily spin up with this config. Specify the display device on host by doing following.

script/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ fi
3232
if [[ ${UPDATE_DOCKERFILES} == OFF ]]; then
3333
build_args=$(env | cut -f1 -d= | grep -E '_(proxy|REPO|VER)$' | sed 's/^/--build-arg /')
3434
if grep -q 'AS build' "${DIR}/Dockerfile"; then
35-
sudo -E docker build --network=host ${BUILD_CACHE} --target build -t "${DOCKER_PREFIX}/${IMAGE}:build" "$DIR" $build_args
35+
docker build --network=host ${BUILD_CACHE} --target build -t "${DOCKER_PREFIX}/${IMAGE}:build" "$DIR" $build_args
3636
fi
3737

38-
sudo -E docker build --network=host ${FULL_CACHE} -t "${DOCKER_PREFIX}/${IMAGE}:${BUILD_VERSION}" -t "${DOCKER_PREFIX}/${IMAGE}:latest" "$DIR" $build_args
38+
docker build --network=host ${FULL_CACHE} -t "${DOCKER_PREFIX}/${IMAGE}:${BUILD_VERSION}" -t "${DOCKER_PREFIX}/${IMAGE}:latest" "$DIR" $build_args
3939
elif [[ ${UPDATE_DOCKERHUB_README} == ON ]]; then
4040
README_FILEPATH="$(echo "$PWD/README.md" | sed 's/build\///')"
4141
${SCRIPT_ROOT}/update-dockerhub-readme.sh ${DOCKER_PREFIX} ${IMAGE} ${README_FILEPATH}

script/qatbuild.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ fi
77

88
if test -d /opt/intel/QAT; then
99
if test ! -f "${DIR}/qat.tar.gz"; then
10-
sudo tar cfz "${DIR}/qat.tar.gz" /opt/intel/QAT/build $(find /opt/intel/QAT -name "*.h") /etc/udev/rules.d/00-qat.rules --exclude /opt/intel/QAT/*.tar.gz
11-
sudo chown $(id -u).$(id -g) "${DIR}/qat.tar.gz"
10+
docker run --rm -v /opt/intel/QAT:/opt/intel/QAT:ro -v /etc/udev:/etc/udev:ro -v "${DIR}:/home:rw" -it busybox /bin/sh -c "tar cfz /home/qat.tar.gz /opt/intel/QAT/build \$(find /opt/intel/QAT -name '*.h') /etc/udev/rules.d/00-qat.rules --exclude /opt/intel/QAT/*.tar.gz && chown $(id -u).$(id -g) /home/qat.tar.gz"
1211
fi
1312
export QAT_GID_VER=$(getent group qat | cut -f3 -d:)
1413
. "${DIR}/../../../../script/build.sh"

script/shell.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [[ -z $TRAVIS && -z $JENKINS_URL ]]; then DOCKER_IT="-it"; else DOCKER_IT="";
1616
TEST="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)/../test/"
1717

1818
if [[ $IMAGE == *vcaca* ]]; then
19-
sudo -E docker run $DEVICE_DIR --rm --user root --privileged -v /var/tmp:/var/tmp -v "${TEST}:/mnt:ro" $(env | cut -f1 -d= | grep -E '_(proxy|REPO|VER)$' | sed 's/^/-e /') $(grep '^ARG .*=' "${DIR}/Dockerfile" | sed 's/^ARG \([^=]*\)=.*/-e \1/') $DOCKER_IT "${DOCKER_PREFIX}/${IMAGE}" "${@:-/bin/bash}"
19+
docker run $DEVICE_DIR --rm --user root --privileged -v /var/tmp:/var/tmp -v "${TEST}:/mnt:ro" $(env | cut -f1 -d= | grep -E '_(proxy|REPO|VER)$' | sed 's/^/-e /') $(grep '^ARG .*=' "${DIR}/Dockerfile" | sed 's/^ARG \([^=]*\)=.*/-e \1/') $DOCKER_IT "${DOCKER_PREFIX}/${IMAGE}" "${@:-/bin/bash}"
2020
else
21-
sudo -E docker run $DEVICE_DIR --rm -v "${TEST}:/mnt:ro" $(env | cut -f1 -d= | grep -E '_(proxy|REPO|VER)$' | sed 's/^/-e /') $(grep '^ARG .*=' "${DIR}/Dockerfile" | sed 's/^ARG \([^=]*\)=.*/-e \1/') $DOCKER_IT "${DOCKER_PREFIX}/${IMAGE}" "${@:-/bin/bash}"
21+
docker run $DEVICE_DIR --rm -v "${TEST}:/mnt:ro" $(env | cut -f1 -d= | grep -E '_(proxy|REPO|VER)$' | sed 's/^/-e /') $(grep '^ARG .*=' "${DIR}/Dockerfile" | sed 's/^ARG \([^=]*\)=.*/-e \1/') $DOCKER_IT "${DOCKER_PREFIX}/${IMAGE}" "${@:-/bin/bash}"
2222
fi

0 commit comments

Comments
 (0)