Skip to content

Commit 1e0b783

Browse files
committed
Run Linux RPM in Rocky container
1 parent e4e64f7 commit 1e0b783

File tree

2 files changed

+32
-15
lines changed

2 files changed

+32
-15
lines changed

.github/workflows/test-installers.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
# TODO: Re-enable (see https://github.com/mongodb-js/compass/actions/runs/13281152689/job/37079619474)
4040
# - linux_tar
4141
# TODO: Enable (needs a docker container)
42-
# - linux_rpm
42+
- linux_rpm
4343
hadron-distribution:
4444
- compass
4545
- compass-readonly
@@ -78,10 +78,20 @@ jobs:
7878
# runs-on: ubuntu-latest
7979
# arch: x64
8080
# hadron-platform: linux
81-
# - package: linux_rpm
82-
# runs-on: ubuntu-latest
83-
# arch: x64
84-
# hadron-platform: linux
81+
- package: linux_rpm
82+
runs-on: ubuntu-latest
83+
arch: x64
84+
hadron-platform: linux
85+
post-checkout-command: |
86+
dnf install -y gcc gcc-c++ make git nss dbus xorg-x11-server-Xvfb yum-utils
87+
# Enable the devel repo to install compat-openssl11 (bringing libcrupto.so.1.1 to run mongod)
88+
dnf config-manager --set-enabled devel
89+
dnf update -y
90+
dnf install -y compat-openssl11
91+
container:
92+
image: rockylinux:9
93+
volumes:
94+
- ${{ github.workspace }}:/compass
8595

8696
# Install the update server for auto-update tests
8797
- test: auto-update-from
@@ -124,6 +134,7 @@ jobs:
124134
test: time-to-first-query
125135

126136
runs-on: ${{ matrix.runs-on }}
137+
container: ${{ matrix.container }}
127138
env:
128139
DEBUG: compass:smoketests:*
129140
steps:
@@ -134,6 +145,11 @@ jobs:
134145
with:
135146
node-version: 20
136147
cache: "npm"
148+
149+
- name: Run post-checkout command
150+
if: matrix.post-checkout-command
151+
run: ${{ matrix.post-checkout-command }}
152+
137153
- name: Cache downloads
138154
uses: actions/cache@v4
139155
with:
@@ -174,6 +190,9 @@ jobs:
174190
HADRON_DISTRIBUTION: ${{ matrix.hadron-distribution }}
175191
PLATFORM: ${{ matrix.hadron-platform }}
176192
ARCH: ${{ matrix.arch }}
193+
# Pass a "fake" DISTRO_ID environment to inform the "mongodb-download-url" package
194+
# See https://github.com/mongodb-js/devtools-shared/blob/aff66db7b7fc4f8ecaec2383fd4e8c116733a7e4/packages/download-url/src/linux-distro.ts#L14
195+
DISTRO_ID: ${{ matrix.package == 'linux_rpm' && 'rhel80' }}
177196
# Exposing token to prevent update server from being rate limited
178197
GITHUB_TOKEN: ${{ github.token }}
179198
working-directory: packages/compass-smoke-tests

packages/compass-smoke-tests/src/installers/linux-rpm.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@ function getPackageName(filepath: string) {
3030
* Check if a package is installed (by name)
3131
*/
3232
export function isInstalled(packageName: string) {
33-
const result = cp.spawnSync(
34-
'sudo',
35-
['dnf', 'list', 'installed', packageName],
36-
{
37-
stdio: 'inherit',
38-
}
39-
);
33+
const result = cp.spawnSync('dnf', ['list', 'installed', packageName], {
34+
stdio: 'inherit',
35+
});
4036
return result.status === 0;
4137
}
4238

@@ -53,7 +49,7 @@ export function installLinuxRpm({
5349

5450
function uninstall() {
5551
debug('Uninstalling %s', filepath);
56-
execute('sudo', ['dnf', 'remove', '-y', packageName]);
52+
execute('dnf', ['remove', '-y', packageName]);
5753
}
5854

5955
if (isInstalled(packageName)) {
@@ -71,7 +67,7 @@ export function installLinuxRpm({
7167
!fs.existsSync(installPath),
7268
`Expected no install directory to exist: ${installPath}`
7369
);
74-
execute('sudo', ['dnf', 'install', '-y', filepath]);
70+
execute('dnf', ['install', '-y', filepath]);
7571

7672
assert(isInstalled(packageName), 'Expected the package to be installed');
7773
assert(
@@ -80,7 +76,9 @@ export function installLinuxRpm({
8076
);
8177

8278
// Check that the executable will run without being quarantined or similar
83-
execute('xvfb-run', [appPath, '--version']);
79+
// Passing --no-sandbox because RHEL and Rocky usually run as root and --disable-gpu to avoid warnings
80+
// (see compass-e2e-tests/helpers/chrome-startup-flags.ts for details)
81+
execute('xvfb-run', [appPath, '--version', '--no-sandbox', '--disable-gpu']);
8482

8583
return {
8684
appName,

0 commit comments

Comments
 (0)