File tree 11 files changed +14
-39
lines changed
local-features/setup-user
11 files changed +14
-39
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,6 @@ export DOCKER_BUILDKIT=1
7
7
echo " (*) Installing @devcontainer/cli"
8
8
npm install -g @devcontainers/cli
9
9
10
- id_label=" test-container=${IMAGE} "
11
- id_image=" ${IMAGE} -test-image"
12
10
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} "
15
12
devcontainer up --id-label ${id_label} --workspace-folder " src/${IMAGE} /"
16
-
Original file line number Diff line number Diff line change @@ -32,12 +32,13 @@ install_bc() {
32
32
check_image_size () {
33
33
IMAGE=" $1 "
34
34
THRESHOLD_IN_GB=" $2 "
35
- id_image= " $3 "
35
+
36
36
# call install_bc
37
37
install_bc
38
38
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 " )
41
42
# Find the size of the image
42
43
IMAGE_SIZE=$( docker image inspect --format=' {{.Size}}' " $IMAGE_ID " )
43
44
# Output the size
Original file line number Diff line number Diff line change @@ -10,15 +10,14 @@ set -e
10
10
# Run actual test
11
11
echo " (*) Running test..."
12
12
id_label=" test-container=${IMAGE} "
13
- id_image=" ${IMAGE} -test-image"
14
13
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'
15
14
16
15
echo " (*) Docker image details..."
17
16
docker images
18
17
# Checking size of universal image
19
18
20
19
if [ $IMAGE == " universal" ]; then
21
- check_image_size $IMAGE $THRESHOLD_IN_GB $id_image
20
+ check_image_size $IMAGE $THRESHOLD_IN_GB
22
21
fi
23
22
24
23
# Clean up
Original file line number Diff line number Diff line change 29
29
- name : Checkout
30
30
id : checkout
31
31
uses : actions/checkout@v3
32
-
33
32
34
33
- name : Build and push dev tags
35
34
id : build_and_push
41
40
STUB_REGISTRY_BASE_PATH : ${{ secrets.STUB_REGISTRY_BASE_PATH }}
42
41
SECONDARY_REGISTRY_BASE_PATH : ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
43
42
TOKEN_NAME : ${{ secrets.TOKEN_NAME }}
44
- PASSWORD : ${{ secrets.PASSWORD }}
43
+ PASSWORD : ${{ secrets.PASSWORD }}
45
44
run : |
46
45
set -e
47
46
Original file line number Diff line number Diff line change 36
36
with :
37
37
path : ' release'
38
38
ref : ${{ github.event.inputs.release }}
39
-
39
+
40
40
- name : Build and push
41
41
id : build_and_push
42
42
env :
Original file line number Diff line number Diff line change 28
28
29
29
- name : Checkout
30
30
id : checkout
31
- uses : actions/checkout@v3
31
+ uses : actions/checkout@v3
32
32
33
33
- name : Get tag name
34
34
run : echo "TAG=$(echo "${{ github.ref }}" | grep -oP 'refs/tags/\K(.+)')" >> $GITHUB_ENV
Original file line number Diff line number Diff line change 19
19
- name : Checkout
20
20
id : checkout
21
21
uses : actions/checkout@v3
22
-
23
22
- name : Smoke test
24
23
env :
25
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26
25
id : smoke_test
27
26
uses : ./.github/actions/smoke-test
28
27
with :
Original file line number Diff line number Diff line change @@ -69,9 +69,8 @@ RUN apt-get update \
69
69
# Install tools and shells not in common script
70
70
&& apt-get install -yq vim vim-doc xtail software-properties-common libsecret-1-dev \
71
71
# Install additional tools (useful for 'puppeteer' project)
72
- # Also added three new libraries to ensure google chrome sucessful installation
73
72
&& 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 \
75
74
# Clean up
76
75
&& apt-get autoremove -y && apt-get clean -y \
77
76
# Move first run notice to right spot
Original file line number Diff line number Diff line change 7
7
"ghcr.io/devcontainers/features/common-utils:2" : {
8
8
"username" : " codespace" ,
9
9
"userUid" : " 1000" ,
10
- "userGid" : " 1000"
10
+ "userGid" : " 1000"
11
11
},
12
12
"ghcr.io/devcontainers/features/dotnet:2" : {
13
13
"version" : " 8.0" ,
103
103
],
104
104
"remoteUser" : " codespace" ,
105
105
"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
+
111
107
// Use 'forwardPorts' to make a list of ports inside the container available locally.
112
108
// "forwardPorts": [],
113
109
Original file line number Diff line number Diff line change @@ -96,16 +96,4 @@ bash -c ". /usr/local/share/nvm/nvm.sh && nvm use 18"
96
96
bash -c
" npm -g install -g [email protected] "
97
97
bash -c " . /usr/local/share/nvm/nvm.sh && nvm use stable"
98
98
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
-
111
99
echo " Done!"
Original file line number Diff line number Diff line change 2
2
cd $( dirname " $0 " )
3
3
4
4
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
7
5
8
6
# Run common tests
9
7
checkCommon
@@ -204,4 +202,4 @@ check "conda-install-tensorflow" bash -c "conda create --name test-env -c conda-
204
202
check " conda-install-pytorch" bash -c " conda create --name test-env -c conda-forge --yes pytorch"
205
203
206
204
# Report result
207
- reportResults
205
+ reportResults
You can’t perform that action at this time.
0 commit comments