Skip to content

Commit 66cc19d

Browse files
committed
Run against test wizard branch for amd64
1 parent ae752eb commit 66cc19d

4 files changed

Lines changed: 95 additions & 120 deletions

File tree

Dockerfile

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@ ENV NVIDIA_DRIVER_CAPABILITIES="compute,graphics,video,utility"
2020
# Container setup
2121
RUN \
2222
echo "**** install packages ****" && \
23-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
24-
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu noble stable" > \
25-
/etc/apt/sources.list.d/docker.list && \
23+
install -m 0755 -d /etc/apt/keyrings && \
24+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \
25+
chmod a+r /etc/apt/keyrings/docker.asc && \
26+
printf "Types: deb\nURIs: https://download.docker.com/linux/ubuntu\nSuites: $(. /etc/os-release && echo ${UBUNTU_CODENAME:-$VERSION_CODENAME})\nComponents: stable\nArchitectures: $(dpkg --print-architecture)\nSigned-By: /etc/apt/keyrings/docker.asc" > /etc/apt/sources.list.d/docker.sources && \
27+
cat /etc/apt/sources.list.d/docker.sources && \
2628
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
2729
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
2830
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
2931
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list && \
3032
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
3133
printf "Package: docker-ce docker-ce-cli docker-ce-rootless-extras\nPin: version 5:29.* \nPin-Priority: 1001" > /etc/apt/preferences.d/docker && \
34+
apt-get update && \
3235
apt-get install -y --no-install-recommends \
3336
btrfs-progs \
3437
build-essential \
@@ -54,7 +57,7 @@ RUN \
5457
usermod -G dockremap dockremap && \
5558
echo 'dockremap:165536:65536' >> /etc/subuid && \
5659
echo 'dockremap:165536:65536' >> /etc/subgid && \
57-
curl -o \
60+
curl -w "%{response_code}" -o \
5861
/usr/local/bin/dind -L \
5962
https://raw.githubusercontent.com/moby/moby/master/hack/dind && \
6063
chmod +x /usr/local/bin/dind && \
@@ -69,40 +72,22 @@ RUN \
6972
curl -o \
7073
/tmp/wizard.tar.gz -L \
7174
# "https://github.com/kasmtech/kasm-install-wizard/archive/refs/tags/${KASM_VERSION}.tar.gz" && \
72-
"https://github.com/kasmtech/kasm-install-wizard/archive/refs/tags/1.18.0.tar.gz" && \
75+
"https://github.com/KodeStar/kasm-install-wizard/archive/refs/heads/feature/KASM-8264-registry-based-wizard-installer.tar.gz" && \
7376
tar xf \
7477
/tmp/wizard.tar.gz -C \
7578
/wizard --strip-components=1 && \
76-
# Enable rolling service images
77-
sed -i "/installFlags = \[.*/a \ installFlags.push('-O');" /wizard/index.js && \
7879
cd /wizard && \
7980
npm install && \
80-
echo "**** add image definitions ****" && \
81-
curl -o \
82-
/tmp/images.tar.gz -L \
83-
#"https://kasm-ci.s3.amazonaws.com/${KASM_VERSION}-images-combined.tar.gz" && \
84-
"https://kasm-ci.s3.amazonaws.com/1.18.0-images-combined.tar.gz" && \
85-
tar xf \
86-
/tmp/images.tar.gz -C \
87-
/ && \
8881
echo "**** add installer ****" && \
8982
curl -o \
9083
/tmp/kasm.tar.gz -L \
9184
"https://kasm-static-content.s3.amazonaws.com/kasm_release_${KASM_VERSION}.tar.gz" && \
9285
tar xf \
9386
/tmp/kasm.tar.gz -C \
9487
/ && \
95-
ALVERSION=$(cat /kasm_release/conf/database/seed_data/default_properties.yaml |awk '/alembic_version/ {print $2}') && \
96-
sed -i \
97-
'/alembic_version/s/.*/alembic_version: '${ALVERSION}'/' \
98-
/kasm_release/conf/database/seed_data/default_images_a* && \
9988
# Don't check for open ports
10089
sed -i 's/-N -e -H/-N -B -e -H/g' /kasm_release/upgrade.sh && \
10190
echo "exit 0" > /kasm_release/install_dependencies.sh && \
102-
# Add our customisations
103-
/kasm_release/bin/utils/yq_$(uname -m) -i \
104-
'.services.proxy.volumes += "/kasm_release/www/img/thumbnails:/srv/www/img/thumbnails"' \
105-
/kasm_release/docker/docker-compose-all.yaml && \
10691
/kasm_release/bin/utils/yq_$(uname -m) -i \
10792
'.services.proxy.depends_on = {"kasm_manager":{"condition": "service_healthy"},"kasm_api":{"condition": "service_healthy"},"kasm_agent":{"condition": "service_started"},"kasm_guac":{"condition": "service_started"}}' \
10893
/kasm_release/docker/docker-compose-all.yaml && \
@@ -118,13 +103,6 @@ RUN \
118103
/kasm_release/bin/utils/yq_$(uname -m) -i \
119104
'.services.kasm_rdp_https_gateway.depends_on = {"proxy":{"condition": "service_started"}}' \
120105
/kasm_release/docker/docker-compose-all.yaml && \
121-
echo "**** copy assets ****" && \
122-
cp \
123-
/kasm_release/www/img/thumbnails/*.png /kasm_release/www/img/thumbnails/*.svg \
124-
/wizard/public/img/thumbnails/ && \
125-
cp \
126-
/kasm_release/conf/database/seed_data/default_images_a* \
127-
/wizard/ && \
128106
useradd -u 70 kasm_db && \
129107
useradd kasm && \
130108
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \

Jenkinsfile

Lines changed: 86 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pipeline {
3030
PR_DOCKERHUB_IMAGE = 'lspipepr/kasm'
3131
DIST_IMAGE = 'ubuntu'
3232
MULTIARCH='true'
33-
CI='true'
33+
CI='false'
3434
CI_WEB='false'
3535
CI_PORT='3000'
3636
CI_SSL='true'
@@ -77,6 +77,7 @@ pipeline {
7777
'''
7878
script{
7979
env.EXIT_STATUS = ''
80+
env.CI_TEST_ATTEMPTED = ''
8081
env.LS_RELEASE = sh(
8182
script: '''docker run --rm quay.io/skopeo/stable:v1 inspect docker://ghcr.io/${LS_USER}/${CONTAINER_NAME}:latest 2>/dev/null | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
8283
returnStdout: true).trim()
@@ -839,6 +840,7 @@ pipeline {
839840
script{
840841
env.CI_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/index.html'
841842
env.CI_JSON_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/report.json'
843+
env.CI_TEST_ATTEMPTED = 'true'
842844
}
843845
sh '''#! /bin/bash
844846
set -e
@@ -1041,98 +1043,13 @@ EOF
10411043
) '''
10421044
}
10431045
}
1044-
// If this is a Pull request send the CI link as a comment on it
1045-
stage('Pull Request Comment') {
1046-
when {
1047-
not {environment name: 'CHANGE_ID', value: ''}
1048-
environment name: 'EXIT_STATUS', value: ''
1049-
}
1050-
steps {
1051-
sh '''#! /bin/bash
1052-
# Function to retrieve JSON data from URL
1053-
get_json() {
1054-
local url="$1"
1055-
local response=$(curl -s "$url")
1056-
if [ $? -ne 0 ]; then
1057-
echo "Failed to retrieve JSON data from $url"
1058-
return 1
1059-
fi
1060-
local json=$(echo "$response" | jq .)
1061-
if [ $? -ne 0 ]; then
1062-
echo "Failed to parse JSON data from $url"
1063-
return 1
1064-
fi
1065-
echo "$json"
1066-
}
1067-
1068-
build_table() {
1069-
local data="$1"
1070-
1071-
# Get the keys in the JSON data
1072-
local keys=$(echo "$data" | jq -r 'to_entries | map(.key) | .[]')
1073-
1074-
# Check if keys are empty
1075-
if [ -z "$keys" ]; then
1076-
echo "JSON report data does not contain any keys or the report does not exist."
1077-
return 1
1078-
fi
1079-
1080-
# Build table header
1081-
local header="| Tag | Passed |\\n| --- | --- |\\n"
1082-
1083-
# Loop through the JSON data to build the table rows
1084-
local rows=""
1085-
for build in $keys; do
1086-
local status=$(echo "$data" | jq -r ".[\\"$build\\"].test_success")
1087-
if [ "$status" = "true" ]; then
1088-
status="✅"
1089-
else
1090-
status="❌"
1091-
fi
1092-
local row="| "$build" | "$status" |\\n"
1093-
rows="${rows}${row}"
1094-
done
1095-
1096-
local table="${header}${rows}"
1097-
local escaped_table=$(echo "$table" | sed 's/\"/\\\\"/g')
1098-
echo "$escaped_table"
1099-
}
1100-
1101-
if [[ "${CI}" = "true" ]]; then
1102-
# Retrieve JSON data from URL
1103-
data=$(get_json "$CI_JSON_URL")
1104-
# Create table from JSON data
1105-
table=$(build_table "$data")
1106-
echo -e "$table"
1107-
1108-
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
1109-
-H "Accept: application/vnd.github.v3+json" \
1110-
"https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \
1111-
-d "{\\"body\\": \\"I am a bot, here are the test results for this PR: \\n${CI_URL}\\n${SHELLCHECK_URL}\\n${table}\\"}"
1112-
else
1113-
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
1114-
-H "Accept: application/vnd.github.v3+json" \
1115-
"https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \
1116-
-d "{\\"body\\": \\"I am a bot, here is the pushed image/manifest for this PR: \\n\\n\\`${GITHUBIMAGE}:${META_TAG}\\`\\"}"
1117-
fi
1118-
'''
1119-
1120-
}
1121-
}
11221046
}
11231047
/* ######################
1124-
Send status to Discord
1048+
Comment on PR and Send status to Discord
11251049
###################### */
11261050
post {
11271051
always {
1128-
sh '''#!/bin/bash
1129-
rm -rf /config/.ssh/id_sign
1130-
rm -rf /config/.ssh/id_sign.pub
1131-
git config --global --unset gpg.format
1132-
git config --global --unset user.signingkey
1133-
git config --global --unset commit.gpgsign
1134-
'''
1135-
script{
1052+
script {
11361053
env.JOB_DATE = sh(
11371054
script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''',
11381055
returnStdout: true).trim()
@@ -1175,6 +1092,87 @@ EOF
11751092
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
11761093
}
11771094
}
1095+
script {
1096+
if (env.GITHUBIMAGE =~ /lspipepr/){
1097+
if (env.CI_TEST_ATTEMPTED == "true"){
1098+
sh '''#! /bin/bash
1099+
# Function to retrieve JSON data from URL
1100+
get_json() {
1101+
local url="$1"
1102+
local response=$(curl -s "$url")
1103+
if [ $? -ne 0 ]; then
1104+
echo "Failed to retrieve JSON data from $url"
1105+
return 1
1106+
fi
1107+
local json=$(echo "$response" | jq .)
1108+
if [ $? -ne 0 ]; then
1109+
echo "Failed to parse JSON data from $url"
1110+
return 1
1111+
fi
1112+
echo "$json"
1113+
}
1114+
1115+
build_table() {
1116+
local data="$1"
1117+
1118+
# Get the keys in the JSON data
1119+
local keys=$(echo "$data" | jq -r 'to_entries | map(.key) | .[]')
1120+
1121+
# Check if keys are empty
1122+
if [ -z "$keys" ]; then
1123+
echo "JSON report data does not contain any keys or the report does not exist."
1124+
return 1
1125+
fi
1126+
1127+
# Build table header
1128+
local header="| Tag | Passed |\\n| --- | --- |\\n"
1129+
1130+
# Loop through the JSON data to build the table rows
1131+
local rows=""
1132+
for build in $keys; do
1133+
local status=$(echo "$data" | jq -r ".[\\"$build\\"].test_success")
1134+
if [ "$status" = "true" ]; then
1135+
status="✅"
1136+
else
1137+
status="❌"
1138+
fi
1139+
local row="| "$build" | "$status" |\\n"
1140+
rows="${rows}${row}"
1141+
done
1142+
1143+
local table="${header}${rows}"
1144+
local escaped_table=$(echo "$table" | sed 's/\"/\\\\"/g')
1145+
echo "$escaped_table"
1146+
}
1147+
1148+
if [[ "${CI}" = "true" ]]; then
1149+
# Retrieve JSON data from URL
1150+
data=$(get_json "$CI_JSON_URL")
1151+
# Create table from JSON data
1152+
table=$(build_table "$data")
1153+
echo -e "$table"
1154+
1155+
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
1156+
-H "Accept: application/vnd.github.v3+json" \
1157+
"https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \
1158+
-d "{\\"body\\": \\"I am a bot, here are the test results for this PR: \\n${CI_URL}\\n${SHELLCHECK_URL}\\n${table}\\"}"
1159+
else
1160+
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
1161+
-H "Accept: application/vnd.github.v3+json" \
1162+
"https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \
1163+
-d "{\\"body\\": \\"I am a bot, here is the pushed image/manifest for this PR: \\n\\n\\`${GITHUBIMAGE}:${META_TAG}\\`\\"}"
1164+
fi
1165+
'''
1166+
}
1167+
}
1168+
}
1169+
sh '''#!/bin/bash
1170+
rm -rf /config/.ssh/id_sign
1171+
rm -rf /config/.ssh/id_sign.pub
1172+
git config --global --unset gpg.format
1173+
git config --global --unset user.signingkey
1174+
git config --global --unset commit.gpgsign
1175+
'''
11781176
}
11791177
cleanup {
11801178
sh '''#! /bin/bash

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Find us at:
3535
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/kasm.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/kasm)
3636
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/kasm.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/kasm)
3737
[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-kasm%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-kasm/job/master/)
38-
[![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2Fkasm%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/kasm/latest/index.html)
3938

4039
[Kasm](https://www.kasmweb.com/?utm_campaign=LinuxServer&utm_source=listing) Workspaces is a docker container streaming platform for delivering browser-based access to desktops, applications, and web services. Kasm uses devops-enabled Containerized Desktop Infrastructure (CDI) to create on-demand, disposable, docker containers that are accessible via web browser. Example use-cases include Remote Browser Isolation (RBI), Data Loss Prevention (DLP), Desktop as a Service (DaaS), Secure Remote Access Services (RAS), and Open Source Intelligence (OSINT) collections.
4140

jenkins-vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repo_vars:
1919
- PR_DOCKERHUB_IMAGE = 'lspipepr/kasm'
2020
- DIST_IMAGE = 'ubuntu'
2121
- MULTIARCH='true'
22-
- CI='true'
22+
- CI='false'
2323
- CI_WEB='false'
2424
- CI_PORT='3000'
2525
- CI_SSL='true'

0 commit comments

Comments
 (0)