Skip to content

Commit

Permalink
Merge branch 'rancher-sandbox:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarciaq authored Jan 25, 2025
2 parents 4d5cda4 + 7d7aba7 commit 506edd7
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 20 deletions.
17 changes: 15 additions & 2 deletions .github/actions/setup-environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,21 @@ runs:
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install pass
source /etc/os-release
for id in $ID $ID_LIKE; do
case $id in
suse|opensuse)
sudo zypper --non-interactive install password-store
break;;
rocky|rhel|centos)
sudo dnf install --assumeyes pass
break;;
debian|ubuntu)
sudo apt-get update
sudo apt-get install pass
break;;
esac
done
# Configure the agent to allow default passwords
HOMEDIR="$(gpgconf --list-dirs homedir)" # spellcheck-ignore-line
Expand Down
13 changes: 13 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ ARPNOMODIFY
ARPPRODUCTICON
ARPURLINFOABOUT
asar
assumeyes
atk
authconfig
authdata
Authenticode
Expand Down Expand Up @@ -391,6 +393,7 @@ JOBOBJECT
joycelin
jpe
jsmith
jsontable
julianb
karl
Kaspersky
Expand Down Expand Up @@ -446,6 +449,7 @@ libgtk
libnspr
libnss
libpango
libva
libx
libxcb
libxcomposite
Expand Down Expand Up @@ -558,7 +562,9 @@ nologo
nomount
nonamedreturns
NONINFRINGEMENT
noprofile
noproxy
norc
norestart
normaliser
NOSETENV
Expand Down Expand Up @@ -617,6 +623,7 @@ pgid
pgrep
pidfile
pidfd
pidof
pids
PII
pikachu
Expand Down Expand Up @@ -654,6 +661,7 @@ Privs
PROCARGS
procnet
procnettcp
procps
progresskey
projectroletemplatebinding
Prometheis
Expand Down Expand Up @@ -709,12 +717,14 @@ restclient
restoretip
resyncing
reusecab
rhel
rioinfo
rke
RLENGTH
rmi
roadmap
roboto
rockylinux
Roffline
rolebinding
roletemplate
Expand Down Expand Up @@ -780,6 +790,7 @@ someothername
somepaththatshouldnevereverexist
songgao
sourced
spi
spinkube
spinoperator
splatform
Expand Down Expand Up @@ -933,6 +944,7 @@ wslutils
WWID
wwn
wws
XAUTHORITY
Xcomposite
Xdamage
xdev
Expand All @@ -942,6 +954,7 @@ Xext
Xfixes
xfs
xit
xorg
XPOST
Xrandr
XVar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rdx-host-api-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
- uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
build-args: variant=host-apis
context: bats/tests/extensions/testdata
Expand Down
169 changes: 169 additions & 0 deletions .github/workflows/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}

- name: Download AppImage
run: |
branch=$(cut -d. -f1,2 <<< "${RELEASE_TAG#v}")
read -r artifact_name < <(
curl "${OBS_DOWNLOAD_URL}?jsontable" \
| jq --raw-output ".data[].name | select(endswith(\".AppImage\")) | select(contains(\".release${branch}.\"))"
)
curl -L -o rancher-desktop.AppImage "${OBS_DOWNLOAD_URL}${artifact_name}"
chmod a+x rancher-desktop.AppImage
env:
OBS_DOWNLOAD_URL: https://download.opensuse.org/download/repositories/isv:/Rancher:/dev/AppImage/

- name: Upload macOS aarch-64 artifacts
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
Expand Down Expand Up @@ -83,6 +95,12 @@ jobs:
path: |
rancher-desktop-linux-*.zip
rancher-desktop-linux-*.zip.sha512sum
- name: Upload Linux AppImage
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: application-linux.AppImage
if-no-files-found: error
path: rancher-desktop.AppImage

smoke-test:
name: Smoke test
Expand Down Expand Up @@ -133,3 +151,154 @@ jobs:
name: logs-${{ matrix.platform }}.zip
path: ${{ github.workspace }}/logs
if-no-files-found: warn

appimage-smoke-test:
name: Smoke test AppImage
needs: download-artifacts
strategy:
fail-fast: false
matrix:
include:
- { id: opensuse, image: "registry.opensuse.org/opensuse/tumbleweed:latest" }
- { id: rocky, image: "rockylinux/rockylinux:9" }
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
options: --privileged
steps:
- name: Install dependencies
run: |
source /etc/os-release
for id in $ID $ID_LIKE; do
case $id in
suse|opensuse)
zypper --non-interactive install --recommends \
fuse gawk git GraphicsMagick gtk3-tools jq mozilla-nss sudo xvfb-run
break;;
rocky|rhel|centos)
dnf install --assumeyes \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
/usr/bin/crb enable # spellcheck-ignore-line
dnf install --assumeyes \
at-spi2-atk cups-libs git GraphicsMagick gtk3 jq \
libva nss procps-ng sudo xorg-x11-server-Xvfb
break;;
esac
done
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up environment
uses: ./.github/actions/setup-environment

- name: Set up user
run: |
useradd --create-home --user-group ci-user
export LOGS_DIR=$PWD/logs
export RD_LOGS_DIR=$LOGS_DIR/rd
echo "LOGS_DIR=$LOGS_DIR" >> "$GITHUB_ENV"
echo "RD_LOGS_DIR=$RD_LOGS_DIR" >> "$GITHUB_ENV"
mkdir -p $LOGS_DIR
chown ci-user "$LOGS_DIR"
sudo --user=ci-user mkdir "$RD_LOGS_DIR"
- name: Download AppImage
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: application-linux.AppImage

- name: Start Rancher Desktop
id: start-rancher-desktop
run: |
set -o xtrace
chmod a+x rancher-desktop.AppImage
inner_command=(
xvfb-run
--auto-servernum
--server-args='-screen 0 1280x960x24'
./rancher-desktop.AppImage
--no-sandbox
--enable-logging=stderr
--v=1
--no-modal-dialogs
--kubernetes.enabled
)
sudo --user=ci-user \
RD_DEBUG_ENABLED=1 RD_LOGS_DIR=$RD_LOGS_DIR RD_TEST=smoke \
script \
--log-out $LOGS_DIR/appimage-${{ matrix.id }}.log \
--command "${inner_command[*]@Q}" \
&
echo "TARGET_PID=$!" >> "$GITHUB_ENV"
- name: Wait for backend
shell: sudo --user=ci-user bash --noprofile --norc -eo pipefail {0}
run: |
deadline=$(( $(date +%s) + 10 * 60 ))
state=UNKNOWN
while [[ $(date +%s) -lt $deadline ]]; do
printf "Waiting for backend: (%s) %s/%s\n" "$state" "$(date)" \
"$({ date --date="@$deadline" || date -j -f %s "$deadline"; } 2>/dev/null)"
if [[ ! -d /proc/$TARGET_PID ]]; then
echo "Process $TARGET_PID exited" >&2
exit 1
fi
rd_pid=$(pidof --separator $'\n' rancher-desktop | sort -n | head -n 1 || echo missing)
if [[ ! -e /proc/$rd_pid/exe ]]; then
state=NOT_RUNNING
sleep 10
continue
fi
if [[ ! -e $HOME/.local/share/rancher-desktop/rd-engine.json ]]; then
state=NO_SERVER_CONFIG
sleep 10
continue
fi
rdctl=$(dirname "$(readlink /proc/$rd_pid/exe)")/resources/resources/linux/bin/rdctl
state=$("$rdctl" api /v1/backend_state || echo '{"vmState": "NO_RESPONSE"}')
state=$(jq --raw-output .vmState <<< "$state")
case "$state" in
ERROR)
echo "Backend reached error state." >&2
exit 1;;
STARTED|DISABLED)
printf "PID %s has reached state %s, accepting\n" "$rd_pid" "$state"
exit 0;;
*)
printf "Backend state: %s\n" "$state";;
esac
sleep 10
done
echo "Timed out waiting for backend to stabilize." >&2
printf "Current time: %s\n" "$(date)" >&2
printf "Deadline: %s\n" >&2 \
"$({ date --date="@$deadline" || date -j -f %s "$deadline"; } 2>/dev/null)"
exit 1
- name: Take screenshot
if: failure() && steps.start-rancher-desktop.outcome == 'success'
continue-on-error: true
shell: >-
sudo --user=ci-user LOGS_DIR=$LOGS_DIR
bash --noprofile --norc -eo pipefail {0}
run: |
set -o xtrace -o errexit
PID=$(pidof rancher-desktop.AppImage || echo missing)
if [[ ! -r /proc/$PID/environ ]]; then
echo "Rancher Desktop is not running" >&2
exit 0
fi
export $(gawk 'BEGIN { RS="\0"; FS="=" } ($1 == "DISPLAY" || $1 == "XAUTHORITY") { print }' \
< /proc/$PID/environ)
env
export MAGICK_DEBUG=All # spellcheck-ignore-line
gm import -window root -verbose $LOGS_DIR/screenshot-${{ matrix.id }}.png
- name: Upload logs
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: always()
with:
name: logs-appimage-${{ matrix.id }}.zip
path: ${{ github.workspace }}/logs
if-no-files-found: warn
4 changes: 2 additions & 2 deletions .github/workflows/smoke-test/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ wait_for_backend() {
deadline=$(( $(date +%s) + 10 * 60 ))

while [[ $(date +%s) -lt $deadline ]]; do
state=$("$RDCTL" api /v1/backend_state || echo '{"vmState": "UNREADY"}')
state=$("$RDCTL" api /v1/backend_state || echo '{"vmState": "NO_RESPONSE"}')
state=$(jq --raw-output .vmState <<< "$state")
case "$state" in
ERROR)
Expand All @@ -215,7 +215,7 @@ wait_for_backend() {
esac

# if we get here, either we failed to get state or it's starting.
printf "Waiting for backend: %s/%s\n" "$(date)" \
printf "Waiting for backend: (%s) %s/%s\n" "$state" "$(date)" \
"$({ date --date="@$deadline" || date -j -f %s "$deadline"; } 2>/dev/null)"
sleep 10
done
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"@nuxtjs/eslint-config-typescript": "11.0.0",
"@nuxtjs/router-extras": "1.1.1",
"@nuxtjs/style-resources": "1.2.2",
"@playwright/test": "1.49.1",
"@playwright/test": "1.50.0",
"@types/cross-spawn": "6.0.6",
"@types/dompurify": "3.2.0",
"@types/ejs": "3.1.5",
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2588,12 +2588,12 @@
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==

"@playwright/test@1.49.1":
version "1.49.1"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.49.1.tgz#55fa360658b3187bfb6371e2f8a64f50ef80c827"
integrity sha512-Ky+BVzPz8pL6PQxHqNRW1k3mIyv933LML7HktS8uik0bUXNCdPhoS/kLihiO1tMf/egaJb4IutXd7UywvXEW+g==
"@playwright/test@1.50.0":
version "1.50.0"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.50.0.tgz#25c63a09f833f89da4d54ad67db7900359e2d11d"
integrity sha512-ZGNXbt+d65EGjBORQHuYKj+XhCewlwpnSd/EDuLPZGSiEWmgOJB5RmMCCYGy5aMfTs9wx61RivfDKi8H/hcMvw==
dependencies:
playwright "1.49.1"
playwright "1.50.0"

"@polka/url@^1.0.0-next.20":
version "1.0.0-next.21"
Expand Down Expand Up @@ -11051,17 +11051,17 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0:
dependencies:
find-up "^4.0.0"

playwright-core@1.49.1:
version "1.49.1"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.49.1.tgz#32c62f046e950f586ff9e35ed490a424f2248015"
integrity sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==
playwright-core@1.50.0:
version "1.50.0"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.50.0.tgz#28dd6a1488211c193933695ed337a5b44d46867c"
integrity sha512-CXkSSlr4JaZs2tZHI40DsZUN/NIwgaUPsyLuOAaIZp2CyF2sN5MM5NJsyB188lFSSozFxQ5fPT4qM+f0tH/6wQ==

playwright@1.49.1:
version "1.49.1"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.49.1.tgz#830266dbca3008022afa7b4783565db9944ded7c"
integrity sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==
playwright@1.50.0:
version "1.50.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.50.0.tgz#ccaf334f948d78139922844de55a18f8ae785410"
integrity sha512-+GinGfGTrd2IfX1TA4N2gNmeIksSb+IAe589ZH+FlmpV3MYTx6+buChGIuDLQwrGNCw2lWibqV50fU510N7S+w==
dependencies:
playwright-core "1.49.1"
playwright-core "1.50.0"
optionalDependencies:
fsevents "2.3.2"

Expand Down

0 comments on commit 506edd7

Please sign in to comment.