Skip to content

Commit 80c0d17

Browse files
authored
Revert "[universal] - Issue universal config change for non-root default code…"
This reverts commit c930750.
1 parent c930750 commit 80c0d17

File tree

11 files changed

+14
-39
lines changed

11 files changed

+14
-39
lines changed

.github/actions/smoke-test/build.sh

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ export DOCKER_BUILDKIT=1
77
echo "(*) Installing @devcontainer/cli"
88
npm install -g @devcontainers/cli
99

10-
id_label="test-container=${IMAGE}"
11-
id_image="${IMAGE}-test-image"
1210
echo "(*) Building image - ${IMAGE}"
13-
devcontainer build --image-name ${id_image} --workspace-folder "src/${IMAGE}/"
14-
echo "(*) Starting container - ${IMAGE}"
11+
id_label="test-container=${IMAGE}"
1512
devcontainer up --id-label ${id_label} --workspace-folder "src/${IMAGE}/"
16-

.github/actions/smoke-test/check-image-size.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ install_bc() {
3232
check_image_size() {
3333
IMAGE="$1"
3434
THRESHOLD_IN_GB="$2"
35-
id_image="$3"
35+
3636
# call install_bc
3737
install_bc
3838

39-
#Read the image id of the original image, not the modified image with uid and gid
40-
IMAGE_ID=$(docker images -q --filter=reference="$id_image")
39+
CONTAINER_ID=$(docker ps -q --filter "label=test-container=$IMAGE")
40+
# Find the image ID of the container
41+
IMAGE_ID=$(docker inspect --format='{{.Image}}' "$CONTAINER_ID")
4142
# Find the size of the image
4243
IMAGE_SIZE=$(docker image inspect --format='{{.Size}}' "$IMAGE_ID")
4344
# Output the size

.github/actions/smoke-test/test.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ set -e
1010
# Run actual test
1111
echo "(*) Running test..."
1212
id_label="test-container=${IMAGE}"
13-
id_image="${IMAGE}-test-image"
1413
devcontainer exec --workspace-folder $(pwd)/src/$IMAGE --id-label ${id_label} /bin/sh -c 'set -e && if [ -f "test-project/test.sh" ]; then cd test-project && if [ "$(id -u)" = "0" ]; then chmod +x test.sh; else sudo chmod +x test.sh; fi && ./test.sh; else ls -a; fi'
1514

1615
echo "(*) Docker image details..."
1716
docker images
1817
# Checking size of universal image
1918

2019
if [ $IMAGE == "universal" ]; then
21-
check_image_size $IMAGE $THRESHOLD_IN_GB $id_image
20+
check_image_size $IMAGE $THRESHOLD_IN_GB
2221
fi
2322

2423
# Clean up

.github/workflows/push-dev.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
- name: Checkout
3030
id: checkout
3131
uses: actions/checkout@v3
32-
3332

3433
- name: Build and push dev tags
3534
id: build_and_push
@@ -41,7 +40,7 @@ jobs:
4140
STUB_REGISTRY_BASE_PATH: ${{ secrets.STUB_REGISTRY_BASE_PATH }}
4241
SECONDARY_REGISTRY_BASE_PATH: ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
4342
TOKEN_NAME: ${{ secrets.TOKEN_NAME }}
44-
PASSWORD: ${{ secrets.PASSWORD }}
43+
PASSWORD: ${{ secrets.PASSWORD }}
4544
run: |
4645
set -e
4746

.github/workflows/push-manual-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
path: 'release'
3838
ref: ${{ github.event.inputs.release }}
39-
39+
4040
- name: Build and push
4141
id: build_and_push
4242
env:

.github/workflows/push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
2929
- name: Checkout
3030
id: checkout
31-
uses: actions/checkout@v3
31+
uses: actions/checkout@v3
3232

3333
- name: Get tag name
3434
run: echo "TAG=$(echo "${{ github.ref }}" | grep -oP 'refs/tags/\K(.+)')" >> $GITHUB_ENV

.github/workflows/smoke-universal.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ jobs:
1919
- name: Checkout
2020
id: checkout
2121
uses: actions/checkout@v3
22-
2322
- name: Smoke test
2423
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2625
id: smoke_test
2726
uses: ./.github/actions/smoke-test
2827
with:

src/universal/.devcontainer/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ RUN apt-get update \
6969
# Install tools and shells not in common script
7070
&& apt-get install -yq vim vim-doc xtail software-properties-common libsecret-1-dev \
7171
# Install additional tools (useful for 'puppeteer' project)
72-
# Also added three new libraries to ensure google chrome sucessful installation
7372
&& apt-get install -y --no-install-recommends libnss3 libnspr4 libatk-bridge2.0-0 libatk1.0-0 libx11-6 libpangocairo-1.0-0 \
74-
libx11-xcb1 libcups2 libxcomposite1 libxdamage1 libxfixes3 libpango-1.0-0 libgbm1 libgtk-3-0 fonts-liberation libvulkan1 xdg-utils \
73+
libx11-xcb1 libcups2 libxcomposite1 libxdamage1 libxfixes3 libpango-1.0-0 libgbm1 libgtk-3-0 \
7574
# Clean up
7675
&& apt-get autoremove -y && apt-get clean -y \
7776
# Move first run notice to right spot

src/universal/.devcontainer/devcontainer.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"ghcr.io/devcontainers/features/common-utils:2": {
88
"username": "codespace",
99
"userUid": "1000",
10-
"userGid": "1000"
10+
"userGid": "1000"
1111
},
1212
"ghcr.io/devcontainers/features/dotnet:2": {
1313
"version": "8.0",
@@ -103,11 +103,7 @@
103103
],
104104
"remoteUser": "codespace",
105105
"containerUser": "codespace",
106-
// This variable is set to ensure puppeteer library gets the sandbox location by default.
107-
// Ref:- https://github.com/devcontainers/internal/issues/249
108-
"containerEnv": {
109-
"CHROME_DEVEL_SANDBOX": "/usr/local/sbin/chrome-devel-sandbox"
110-
},
106+
111107
// Use 'forwardPorts' to make a list of ports inside the container available locally.
112108
// "forwardPorts": [],
113109

src/universal/.devcontainer/local-features/setup-user/install.sh

-12
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,4 @@ bash -c ". /usr/local/share/nvm/nvm.sh && nvm use 18"
9696
bash -c "npm -g install -g [email protected]"
9797
bash -c ". /usr/local/share/nvm/nvm.sh && nvm use stable"
9898

99-
# Installing google chrome to use the sandbox for launching browser using puppeteer library in nodejs.
100-
# Ref:- https://github.com/devcontainers/internal/issues/249
101-
cd /
102-
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
103-
dpkg -i google-chrome-stable_current_amd64.deb
104-
cd /opt/google/chrome/
105-
chown root:root chrome-sandbox
106-
chmod 4755 chrome-sandbox
107-
cp -p chrome-sandbox /usr/local/sbin/chrome-devel-sandbox
108-
cd /
109-
rm -f google-chrome-stable_current_amd64.deb
110-
11199
echo "Done!"

src/universal/test-project/test.sh

100755100644
+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
cd $(dirname "$0")
33

44
source test-utils.sh codespace
5-
#Changing he ownership of dotnet path to ensure oryx-install-dotnet-2.1 test doesn't fail with permission issue
6-
sudo chown -R codespace:codespace /usr/share/dotnet
75

86
# Run common tests
97
checkCommon
@@ -204,4 +202,4 @@ check "conda-install-tensorflow" bash -c "conda create --name test-env -c conda-
204202
check "conda-install-pytorch" bash -c "conda create --name test-env -c conda-forge --yes pytorch"
205203

206204
# Report result
207-
reportResults
205+
reportResults

0 commit comments

Comments
 (0)