Skip to content

Commit

Permalink
Rmoving the UID & GID change, adding workaround for the test & changi…
Browse files Browse the repository at this point in the history
…ng the size check test.
  • Loading branch information
Kaniska244 committed Feb 19, 2025
1 parent 914b9e6 commit 06db0f0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 74 deletions.
11 changes: 8 additions & 3 deletions .github/actions/smoke-test/check-image-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ check_image_size() {
# 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")
if [ $IMAGE == "universal" ]; then
#Read the image id of the original image, not the modified image with uid and gid
IMAGE_ID=$(docker images | grep -v "uid" | sed '1d' | awk '{print $3}')
else
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")
fi
# Find the size of the image
IMAGE_SIZE=$(docker image inspect --format='{{.Size}}' "$IMAGE_ID")
# Output the size
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/push-again.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ jobs:
path: 'release'
ref: ${{ github.event.inputs.release }}

- name: Get userUid from host machine
id: get-useruid
run: |
set -e
USER_UID=$(id -u)
USER_GID=$(id -g)
echo "UserUid::$USER_UID"
echo "UserGid::$USER_GID"
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
echo "USER_GID=$USER_GID" >> $GITHUB_ENV
- name: Build and push
id: build_and_push
env:
Expand All @@ -62,8 +51,6 @@ jobs:
SECONDARY_REGISTRY_BASE_PATH: ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
TOKEN_NAME: ${{ secrets.TOKEN_NAME }}
PASSWORD: ${{ secrets.PASSWORD }}
USER_UID: ${{ env.USER_UID }}
USER_GID: ${{ env.USER_GID }}
run: |
set -e
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/push-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,7 @@ jobs:
- name: Checkout
id: checkout
uses: actions/checkout@v3

- name: Get userUid from host machine
id: get-useruid
run: |
set -e
USER_UID=$(id -u)
USER_GID=$(id -g)
echo "UserUid::$USER_UID"
echo "UserGid::$USER_GID"
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
echo "USER_GID=$USER_GID" >> $GITHUB_ENV


- name: Build and push dev tags
id: build_and_push
Expand All @@ -51,9 +41,7 @@ jobs:
STUB_REGISTRY_BASE_PATH: ${{ secrets.STUB_REGISTRY_BASE_PATH }}
SECONDARY_REGISTRY_BASE_PATH: ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
TOKEN_NAME: ${{ secrets.TOKEN_NAME }}
PASSWORD: ${{ secrets.PASSWORD }}
USER_UID: ${{ env.USER_UID }}
USER_GID: ${{ env.USER_GID }}
PASSWORD: ${{ secrets.PASSWORD }}
run: |
set -e
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/push-manual-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,6 @@ jobs:
with:
path: 'release'
ref: ${{ github.event.inputs.release }}

- name: Get userUid from host machine
id: get-useruid
run: |
set -e
USER_UID=$(id -u)
USER_GID=$(id -g)
echo "UserUid::$USER_UID"
echo "UserGid::$USER_GID"
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
echo "USER_GID=$USER_GID" >> $GITHUB_ENV

- name: Build and push
id: build_and_push
Expand All @@ -58,8 +47,6 @@ jobs:
SECONDARY_REGISTRY_BASE_PATH: ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
TOKEN_NAME: ${{ secrets.TOKEN_NAME }}
PASSWORD: ${{ secrets.PASSWORD }}
USER_UID: ${{ env.USER_UID }}
USER_GID: ${{ env.USER_GID }}
run: |
set -e
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,7 @@ jobs:
- name: Checkout
id: checkout
uses: actions/checkout@v3

- name: Get userUid from host machine
id: get-useruid
run: |
set -e
USER_UID=$(id -u)
USER_GID=$(id -g)
echo "UserUid::$USER_UID"
echo "UserGid::$USER_GID"
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
echo "USER_GID=$USER_GID" >> $GITHUB_ENV
uses: actions/checkout@v3

- name: Get tag name
run: echo "TAG=$(echo "${{ github.ref }}" | grep -oP 'refs/tags/\K(.+)')" >> $GITHUB_ENV
Expand All @@ -55,8 +44,6 @@ jobs:
SECONDARY_REGISTRY_BASE_PATH: ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
TOKEN_NAME: ${{ secrets.TOKEN_NAME }}
PASSWORD: ${{ secrets.PASSWORD }}
USER_UID: ${{ env.USER_UID }}
USER_GID: ${{ env.USER_GID }}
run: |
set -e
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/smoke-universal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,10 @@ jobs:
- name: Checkout
id: checkout
uses: actions/checkout@v3

- name: Get userUid from host machine
id: get-useruid
run: |
set -e
USER_UID=$(id -u)
USER_GID=$(id -g)
echo "UserUid::$USER_UID"
echo "UserGid::$USER_GID"
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
echo "USER_GID=$USER_GID" >> $GITHUB_ENV

- name: Smoke test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USER_UID: ${{ env.USER_UID }}
USER_GID: ${{ env.USER_GID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: smoke_test
uses: ./.github/actions/smoke-test
with:
Expand Down
5 changes: 2 additions & 3 deletions src/universal/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "codespace",
//Getting the UID & GID values of the host machine via GitHub actions
"userUid": "${localEnv:USER_UID}",
"userGid": "${localEnv:USER_GID}"
"userUid": "1000",
"userGid": "1000"
},
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "8.0",
Expand Down
2 changes: 2 additions & 0 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

0 comments on commit 06db0f0

Please sign in to comment.