Skip to content

Commit 4031b74

Browse files
committed
feat(MongoBinaryDownloadUrl): adjust fedora-rhel mapping based on official documentation
Fedora 34+ mapping is now rhel 9.0 / 9.3 fixes #928
1 parent dd66037 commit 4031b74

File tree

3 files changed

+51
-60
lines changed

3 files changed

+51
-60
lines changed

docs/guides/supported-systems.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,20 @@ Default version is `12` (when in `unstable` or `testing`, otherwise none)
8080

8181
(uses mongodb's `rhel` release)<br/>
8282
Lowest supported Distribution version is `6`<br/>
83-
Highest version is `36` (see note) (higher versions will be clamped to this value)<br/>
84-
Default version is `34` (when above or equal to `34`, otherwise none)
83+
Highest version is `42` (see note) (higher versions will be clamped to this value)<br/>
84+
Default version is `28` (when above or equal to `28`, otherwise none)
85+
86+
Mongodb compat chart (x86_64)
87+
(Limited to currently known mongodb versions as of writing)
88+
89+
| Fedora versions | RHEL mapping | Mongodb versions |
90+
| :-------------: | :----------: | :----------------: |
91+
| `>=34` | `9.0 \| 9.3` | `>=6.0.4 <=8.0.9` |
92+
| `>=28` | `8.0` | `>=3.4.24 <=8.0.9` |
8593

8694
:::note
87-
Fedora 36 and onwards dont ship openssl1.1 anymore by default and currently needs to be manually installed.
88-
There are currently no newer mongodb builds that support the newer provided openssl.
95+
There are no official builds from mongodb for fedora.
96+
This mapping to RHEL is based on the table in [Relationship between Fedora and RHEL](https://docs.fedoraproject.org/en-US/quick-docs/fedora-and-red-hat-enterprise-linux/index.html#_history_of_red_hat_enterprise_linux_and_fedora).
8997
:::
9098

9199
### Rhel

packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
337337
*/
338338
getFedoraVersionString(os: LinuxOS): string {
339339
const fedoraVer: number = parseInt(os.release, 10);
340+
const coercedVersion = semver.coerce(this.version);
341+
342+
if (isNullOrUndefined(coercedVersion)) {
343+
throw new UnknownVersionError(this.version);
344+
}
340345

341346
const rhelOS: LinuxOS = {
342347
os: 'linux',
@@ -345,9 +350,19 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
345350
release: '8.0',
346351
};
347352

348-
// 36 and onwards dont ship with libcrypto.so.1.1 anymore and need to be manually installed ("openssl1.1")
349-
// 34 onward dosnt have "compat-openssl10" anymore, and only build from 4.0.24 are available for "rhel80"
350-
if (fedoraVer >= 34) {
353+
// rough fedora->rhel version mapping
354+
// https://docs.fedoraproject.org/en-US/quick-docs/fedora-and-red-hat-enterprise-linux/index.html
355+
356+
// as of mongodb 8.0.9, there are currently no binaries for rhel 10.0 / fedora 40
357+
358+
if (fedoraVer >= 34 && semver.satisfies(coercedVersion, '>=8.0.0')) {
359+
// since mongodb 8.0.0, they only ship "rhel93" and no more "rhel90"
360+
rhelOS.release = '9.3';
361+
} else if (fedoraVer >= 34) {
362+
// 36 and onwards dont ship with libcrypto.so.1.1 anymore and need to be manually installed ("openssl1.1")
363+
// 34 onward dosnt have "compat-openssl10" anymore, and only build from 4.0.24 are available for "rhel80"
364+
rhelOS.release = '9.0';
365+
} else if (fedoraVer >= 28) {
351366
rhelOS.release = '8.0';
352367
} else if (fedoraVer >= 19) {
353368
rhelOS.release = '7.0';
@@ -408,6 +423,8 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
408423
}
409424
}
410425

426+
// as of mongodb 8.0.9, there are currently no binaries for rhel 10.0
427+
411428
if (semver.satisfies(releaseAsSemver, '>=9.3.0')) {
412429
// since mongodb 8.0.0 there are only binaries for `rhel93`, no more `rhel90`
413430
name += '93';

packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts

Lines changed: 19 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ describe('MongoBinaryDownloadUrl', () => {
10961096
});
10971097

10981098
describe('for fedora', () => {
1099-
it('fedora 32 (x86_64) & 4.0.24 (using rhel70)', async () => {
1099+
it('fedora 32 (x86_64) & 4.0.24 (using rhel80)', async () => {
11001100
const du = new MongoBinaryDownloadUrl({
11011101
platform: 'linux',
11021102
arch: 'x64',
@@ -1108,50 +1108,16 @@ describe('MongoBinaryDownloadUrl', () => {
11081108
},
11091109
});
11101110

1111-
expect(await du.getDownloadUrl()).toBe(
1112-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.0.24.tgz'
1113-
);
1114-
});
1115-
1116-
it('fedora 34 (x86_64) & 4.0.24 (using rhel80)', async () => {
1117-
const du = new MongoBinaryDownloadUrl({
1118-
platform: 'linux',
1119-
arch: 'x64',
1120-
version: '4.0.24',
1121-
os: {
1122-
os: 'linux',
1123-
dist: 'fedora',
1124-
release: '34',
1125-
},
1126-
});
1127-
11281111
expect(await du.getDownloadUrl()).toBe(
11291112
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-4.0.24.tgz'
11301113
);
11311114
});
11321115

1133-
it('fedora 35 (x86_64) & 5.0.8 (using rhel80)', async () => {
1134-
const du = new MongoBinaryDownloadUrl({
1135-
platform: 'linux',
1136-
arch: 'x64',
1137-
version: '5.0.8',
1138-
os: {
1139-
os: 'linux',
1140-
dist: 'fedora',
1141-
release: '35',
1142-
},
1143-
});
1144-
1145-
expect(await du.getDownloadUrl()).toBe(
1146-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-5.0.8.tgz'
1147-
);
1148-
});
1149-
1150-
it('fedora 36 (x86_64) & 5.0.8 (using rhel80)', async () => {
1116+
it('fedora 36 (x86_64) & 6.0.4 (using rhel90)', async () => {
11511117
const du = new MongoBinaryDownloadUrl({
11521118
platform: 'linux',
11531119
arch: 'x64',
1154-
version: '5.0.8',
1120+
version: '6.0.4',
11551121
os: {
11561122
os: 'linux',
11571123
dist: 'fedora',
@@ -1160,48 +1126,48 @@ describe('MongoBinaryDownloadUrl', () => {
11601126
});
11611127

11621128
expect(await du.getDownloadUrl()).toBe(
1163-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-5.0.8.tgz'
1129+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel90-6.0.4.tgz'
11641130
);
11651131
});
11661132

1167-
it('fedora 36 (x86_64) & 6.0.0 (using rhel80)', async () => {
1133+
it('fedora 36 (x86_64) & 7.0.14 (using rhel90)', async () => {
11681134
const du = new MongoBinaryDownloadUrl({
11691135
platform: 'linux',
11701136
arch: 'x64',
1171-
version: '6.0.0',
1137+
version: '7.0.14',
11721138
os: {
11731139
os: 'linux',
11741140
dist: 'fedora',
11751141
release: '36',
11761142
},
11771143
});
1178-
11791144
expect(await du.getDownloadUrl()).toBe(
1180-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel80-6.0.0.tgz'
1145+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel90-7.0.14.tgz'
11811146
);
11821147
});
11831148

1184-
it('fedora 36 (x86_64) & 7.0.13 (using rhel8)', async () => {
1149+
it('fedora 40 (x86_64) & 7.0.14 (using rhel9)', async () => {
11851150
const du = new MongoBinaryDownloadUrl({
11861151
platform: 'linux',
11871152
arch: 'x64',
1188-
version: '7.0.13',
1153+
version: '7.0.14',
11891154
os: {
11901155
os: 'linux',
11911156
dist: 'fedora',
1192-
release: '36',
1157+
release: '40',
11931158
},
11941159
});
1160+
11951161
expect(await du.getDownloadUrl()).toBe(
1196-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel8-7.0.13.tgz'
1162+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel90-7.0.14.tgz'
11971163
);
11981164
});
11991165

1200-
it('fedora 40 (x86_64) & 7.0.14 (using rhel8)', async () => {
1166+
it('fedora 40 (x86_64) & 8.0.1 (using rhel93)', async () => {
12011167
const du = new MongoBinaryDownloadUrl({
12021168
platform: 'linux',
12031169
arch: 'x64',
1204-
version: '7.0.14',
1170+
version: '8.0.1',
12051171
os: {
12061172
os: 'linux',
12071173
dist: 'fedora',
@@ -1210,24 +1176,24 @@ describe('MongoBinaryDownloadUrl', () => {
12101176
});
12111177

12121178
expect(await du.getDownloadUrl()).toBe(
1213-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel8-7.0.14.tgz'
1179+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel93-8.0.1.tgz'
12141180
);
12151181
});
12161182

1217-
it('fedora 40 (x86_64) & 8.0.1 (using rhel8)', async () => {
1183+
it('fedora 42 (x86_64) & 8.0.9 (using rhel93)', async () => {
12181184
const du = new MongoBinaryDownloadUrl({
12191185
platform: 'linux',
12201186
arch: 'x64',
1221-
version: '8.0.1',
1187+
version: '8.0.9',
12221188
os: {
12231189
os: 'linux',
12241190
dist: 'fedora',
1225-
release: '40',
1191+
release: '42',
12261192
},
12271193
});
12281194

12291195
expect(await du.getDownloadUrl()).toBe(
1230-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel8-8.0.1.tgz'
1196+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel93-8.0.9.tgz'
12311197
);
12321198
});
12331199
});

0 commit comments

Comments
 (0)