Skip to content

Commit 0025af5

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

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

.github/workflows/test-installers.yml

Lines changed: 25 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,21 @@ 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+
distro-id: rhel80
86+
post-checkout-command: |
87+
dnf install -y gcc gcc-c++ make git nss dbus xorg-x11-server-Xvfb yum-utils
88+
# Enable the devel repo to install compat-openssl11 (bringing libcrupto.so.1.1 to run mongod)
89+
dnf config-manager --set-enabled devel
90+
dnf update -y
91+
dnf install -y compat-openssl11
92+
container:
93+
image: rockylinux:9
94+
volumes:
95+
- ${{ github.workspace }}:/compass
8596

8697
# Install the update server for auto-update tests
8798
- test: auto-update-from
@@ -124,6 +135,7 @@ jobs:
124135
test: time-to-first-query
125136

126137
runs-on: ${{ matrix.runs-on }}
138+
container: ${{ matrix.container }}
127139
env:
128140
DEBUG: compass:smoketests:*
129141
steps:
@@ -134,6 +146,11 @@ jobs:
134146
with:
135147
node-version: 20
136148
cache: "npm"
149+
150+
- name: Run post-checkout command
151+
if: matrix.post-checkout-command
152+
run: ${{ matrix.post-checkout-command }}
153+
137154
- name: Cache downloads
138155
uses: actions/cache@v4
139156
with:
@@ -174,6 +191,9 @@ jobs:
174191
HADRON_DISTRIBUTION: ${{ matrix.hadron-distribution }}
175192
PLATFORM: ${{ matrix.hadron-platform }}
176193
ARCH: ${{ matrix.arch }}
194+
# Useful to pass a "fake" DISTRO_ID environment to inform the "mongodb-download-url" package
195+
# See https://github.com/mongodb-js/devtools-shared/blob/aff66db7b7fc4f8ecaec2383fd4e8c116733a7e4/packages/download-url/src/linux-distro.ts#L14
196+
DISTRO_ID: ${{ matrix.distro-id }}
177197
# Exposing token to prevent update server from being rate limited
178198
GITHUB_TOKEN: ${{ github.token }}
179199
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)