Skip to content

Commit

Permalink
Updating with the changes suggested for UID & GID issue for oryx-inst…
Browse files Browse the repository at this point in the history
…all-dotnet-2.1 resr step to succeed. Also change done in image size check part.
  • Loading branch information
Kaniska244 committed Feb 24, 2025
1 parent 80c0d17 commit 34e030a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .github/actions/smoke-test/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export DOCKER_BUILDKIT=1
echo "(*) Installing @devcontainer/cli"
npm install -g @devcontainers/cli

echo "(*) Building image - ${IMAGE}"
id_label="test-container=${IMAGE}"
id_image="${IMAGE}-test-image"
echo "(*) Building image - ${IMAGE}"
devcontainer build --image-name ${id_image} --workspace-folder "src/${IMAGE}/"
echo "(*) Starting container - ${IMAGE}"
devcontainer up --id-label ${id_label} --workspace-folder "src/${IMAGE}/"

7 changes: 3 additions & 4 deletions .github/actions/smoke-test/check-image-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ install_bc() {
check_image_size() {
IMAGE="$1"
THRESHOLD_IN_GB="$2"

id_image="$3"
# call install_bc
install_bc

CONTAINER_ID=$(docker ps -q --filter "label=test-container=$IMAGE")
# Find the image ID of the container
IMAGE_ID=$(docker inspect --format='{{.Image}}' "$CONTAINER_ID")
#Read the image id of the original image, not the modified image with uid and gid
IMAGE_ID=$(docker images -q --filter=reference="$id_image")
# Find the size of the image
IMAGE_SIZE=$(docker image inspect --format='{{.Size}}' "$IMAGE_ID")
# Output the size
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/smoke-test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ set -e
# Run actual test
echo "(*) Running test..."
id_label="test-container=${IMAGE}"
id_image="${IMAGE}-test-image"
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'

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

if [ $IMAGE == "universal" ]; then
check_image_size $IMAGE $THRESHOLD_IN_GB
check_image_size $IMAGE $THRESHOLD_IN_GB $id_image
fi

# Clean up
Expand Down
6 changes: 2 additions & 4 deletions src/universal/test-project/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
cd $(dirname "$0")

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

# Run common tests
checkCommon
Expand Down Expand Up @@ -132,10 +134,6 @@ check "zsh" zsh --version
# Check env variable
check "RAILS_DEVELOPMENT_HOSTS is set correctly" echo $RAILS_DEVELOPMENT_HOSTS | grep ".githubpreview.dev,.preview.app.github.dev,.app.github.dev"

# Check that we can run a puppeteer node app.
yarn
check "run-puppeteer" node puppeteer.js

# Check Oryx
check "oryx" oryx --version

Expand Down

0 comments on commit 34e030a

Please sign in to comment.