Skip to content

Commit dde8f30

Browse files
fix!: drop support for deprecated APIs
BREAKING CHANGE: `POST /sconify` is dropped, websocket API request `SCONIFY_BUILD` must be used instead; `POST /sconify/build` is dropped, websocket API request `SCONIFY_BUILD` must be used instead; websocket API request `SCONIFY` is dropped, websocket API request `SCONIFY_BUILD` must be used instead; template `Python` is dropped, template `Python3.13` must be used instead; sconeVersion `v5` or `undefined` is dropped, sconeVersion `v5.9` must be used instead; sconeProd `false` or `undefined` is dropped, sconeProd `true` must be used instead.
1 parent f419c36 commit dde8f30

File tree

9 files changed

+83
-446
lines changed

9 files changed

+83
-446
lines changed

api/README.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ The API is composed of:
1010
running)
1111
- 🟢 `GET /health`: will return a JSON object with the health status of the
1212
server and the version of the API.
13-
- 🟠 `POST /sconify`: deprecated, use Websocket API request `SCONIFY_BUILD`
14-
instead.
15-
- 🟠 `POST /sconify/build`: deprecated, use Websocket API request
16-
`SCONIFY_BUILD` instead.
1713

1814
- Websocket API requests:
1915
- 🟢 `SCONIFY_BUILD`: will take a dockerhub image and return a
@@ -22,7 +18,6 @@ The API is composed of:
2218
access to the image's repo in order to push the sconified image
2319
- builds a sconified image out of it
2420
- publishes it to dockerhub with tag suffix
25-
- 🟠 `SCONIFY`: deprecated, use `SCONIFY_BUILD` instead.
2621

2722
## Prerequisites
2823

@@ -64,16 +59,16 @@ npm run start
6459
npm run dev:pretty
6560
```
6661

67-
## deprecations
68-
69-
- `POST /sconify` is deprecated, websocket API request `SCONIFY_BUILD` should be
70-
used instead.
71-
- `POST /sconify/build` is deprecated, websocket API request `SCONIFY_BUILD`
72-
should be used instead.
73-
- websocket API request `SCONIFY` is deprecated, websocket API request
74-
`SCONIFY_BUILD` should be used instead.
75-
- template `Python` is deprecated, template `Python3.13` should be used instead.
76-
- sconeVersion `v5` or `undefined` is deprecated, sconeVersion `v5.9` should be
77-
used instead.
78-
- sconeProd `false` or `undefined` is deprecated, sconeProd `true` should be
79-
used instead.
62+
## deprecated and dropped API
63+
64+
- `POST /sconify` is dropped, websocket API request `SCONIFY_BUILD` must be used
65+
instead.
66+
- `POST /sconify/build` is dropped, websocket API request `SCONIFY_BUILD` must
67+
be used instead.
68+
- websocket API request `SCONIFY` is dropped, websocket API request
69+
`SCONIFY_BUILD` must be used instead.
70+
- template `Python` is dropped, template `Python3.13` must be used instead.
71+
- sconeVersion `v5` or `undefined` is dropped, sconeVersion `v5.9` must be used
72+
instead.
73+
- sconeProd `false` or `undefined` is dropped, sconeProd `true` must be used
74+
instead.

api/src/constants/constants.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ export const SCONIFY_IMAGE_NAME = `registry.scontain.com/scone-production/iexec-
66
*
77
* NB: "v5" is the legacy scone version v5.7 (name constrained by version parsing in workerpool)
88
*/
9-
export type SconeVersion = 'v5' | 'v5.9';
9+
export type SconeVersion = 'v5.9';
10+
11+
export type OutdatedSconeVersion = 'v5';
1012

1113
export const SCONIFY_IMAGE_VERSIONS: Record<SconeVersion, string> = {
12-
v5: '5.7.6-v15',
1314
'v5.9': '5.9.1-v16',
1415
};
1516

1617
// This SCONIFY_IMAGE depends on Linux alpine:3.15
1718
// It will be pulled if it's not yet in the local docker
1819
// https://hub.docker.com/layers/library/alpine/3.15/images/sha256-6a0657acfef760bd9e293361c9b558e98e7d740ed0dffca823d17098a4ffddf5?context=explore
1920

20-
export type TemplateName = 'JavaScript' | 'Python' | 'Python3.13';
21+
export type TemplateName = 'JavaScript' | 'Python3.13';
22+
23+
export type OutdatedTemplateName = 'Python';
2124

2225
export const TEMPLATE_CONFIG: Record<
2326
TemplateName,
@@ -29,17 +32,10 @@ export const TEMPLATE_CONFIG: Record<
2932
JavaScript: {
3033
// node binary name does not change from one version to another
3134
binary: '/usr/local/bin/node',
32-
// deprecated for scone 5.7 this was necessary
33-
sconeCuratedImage:
34-
'registry.scontain.com:5050/sconecuratedimages/node:14.4.0-alpine3.11',
3535
},
3636
'Python3.13': {
3737
binary: '/usr/local/bin/python3.13',
3838
},
39-
// deprecated legacy template name Python used Python 3.8
40-
Python: {
41-
binary: '/usr/local/bin/python3.8',
42-
},
4339
};
4440

4541
/**

api/src/index.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import { readFile } from 'node:fs/promises';
22
import express from 'express';
33
import { pino } from 'pino';
4-
import {
5-
deprecated_sconifyHttpHandler,
6-
deprecated_sconifyWsHandler,
7-
} from './sconify/deprecated_sconify.handler.js';
84
import { loggerMiddleware } from './utils/logger.js';
95
import { requestIdMiddleware } from './utils/requestId.js';
10-
import { errorHandlerMiddleware } from './utils/errors.js';
6+
import { errorHandlerMiddleware, OutdatedClientError } from './utils/errors.js';
117
import { attachWebSocketServer } from './utils/websocket.js';
12-
import {
13-
deprecated_sconifyBuildHttpHandler,
14-
sconifyBuildWsHandler,
15-
} from './sconify/sconifyBuild.handler.js';
8+
import { sconifyBuildWsHandler } from './sconify/sconifyBuild.handler.js';
169

1710
const app = express();
1811
const hostname = '0.0.0.0';
@@ -31,10 +24,15 @@ app.use(express.json());
3124
app.use(requestIdMiddleware);
3225
app.use(loggerMiddleware);
3326

34-
// deprecated endpoint, clients should use /sconify/build
35-
app.post('/sconify', deprecated_sconifyHttpHandler);
27+
app.post('/sconify', () => {
28+
throw new OutdatedClientError('/sconify endpoint is no longer supported.');
29+
});
3630

37-
app.post('/sconify/build', deprecated_sconifyBuildHttpHandler);
31+
app.post('/sconify/build', () => {
32+
throw new OutdatedClientError(
33+
'/sconify/build endpoint is no longer supported.'
34+
);
35+
});
3836

3937
// Health endpoint
4038
app.get('/health', (req, res) => {
@@ -58,9 +56,10 @@ const server = app.listen(port, hostname, () => {
5856
attachWebSocketServer({
5957
server,
6058
requestRouter: (requestTarget) => {
61-
// deprecated requestTarget, clients should use SCONIFY_BUILD
6259
if (requestTarget === 'SCONIFY') {
63-
return deprecated_sconifyWsHandler;
60+
throw new OutdatedClientError(
61+
'SCONIFY request target is no longer supported.'
62+
);
6463
}
6564
if (requestTarget === 'SCONIFY_BUILD') {
6665
return sconifyBuildWsHandler;

api/src/sconify/deprecated_sconify.handler.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)