Skip to content

Commit 0545172

Browse files
authored
Update Restate Server to v1.4.0 (#78)
1 parent b83cf8d commit 0545172

12 files changed

+422
-1575
lines changed

lib/restate-constructs/fargate-restate-deployment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const PUBLIC_INGRESS_PORT = 443;
2727
const PUBLIC_ADMIN_PORT = 9070;
2828
const RESTATE_INGRESS_PORT = 8080;
2929
const RESTATE_ADMIN_PORT = 9070;
30-
const RESTATE_IMAGE_DEFAULT = "docker.io/restatedev/restate";
31-
const RESTATE_DOCKER_DEFAULT_TAG = "latest";
30+
const RESTATE_IMAGE_DEFAULT = "docker.restate.dev/restatedev/restate";
31+
const RESTATE_DOCKER_DEFAULT_TAG = "1.4";
3232
const ADOT_DOCKER_DEFAULT_TAG = "latest";
3333

3434
export interface RestateFargateProps {

lib/restate-constructs/single-node-restate-deployment.ts

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ export interface SingleNodeRestateProps {
6565
/** Restate Docker image tag. Defaults to `latest`. */
6666
restateTag?: string;
6767

68+
/** Restate NPM tools tag (used for `restate`/`restatectl`). Defaults to `latest`. */
69+
restateNpmTag?: string;
70+
6871
/**
6972
* EBS data volume settings for Restate data storage. If not specified, a default 8GB volume will be created.
7073
*/
@@ -142,8 +145,9 @@ const RESTATE_INGRESS_PORT = 8080;
142145
const RESTATE_TLS_INGRESS_PORT = 443;
143146
const RESTATE_ADMIN_PORT = 9070;
144147
const RESTATE_TLS_ADMIN_PORT = 9073;
145-
const RESTATE_IMAGE_DEFAULT = "docker.io/restatedev/restate";
146-
const RESTATE_DOCKER_DEFAULT_TAG = "latest";
148+
const RESTATE_IMAGE_DEFAULT = "docker.restate.dev/restatedev/restate";
149+
const RESTATE_DOCKER_DEFAULT_TAG = "1.4";
150+
const RESTATE_NPM_DEFAULT_TAG = "1.4";
147151
const ADOT_DOCKER_DEFAULT_TAG = "latest";
148152
const DATA_DEVICE_NAME = "/dev/sdd";
149153

@@ -213,8 +217,30 @@ export class SingleNodeRestateDeployment extends Construct implements IRestateEn
213217
});
214218
logGroup.grantWrite(this.instanceRole);
215219

216-
const restateImage = props.restateImage ?? RESTATE_IMAGE_DEFAULT;
217-
const restateTag = props.restateTag ?? RESTATE_DOCKER_DEFAULT_TAG;
220+
let restateImage = props.restateImage ?? RESTATE_IMAGE_DEFAULT;
221+
let restateDockerTag = props.restateTag ?? RESTATE_DOCKER_DEFAULT_TAG;
222+
let restateNpmTag = props.restateNpmTag ?? RESTATE_NPM_DEFAULT_TAG;
223+
let useShaDigest = false;
224+
let shaDigest = "";
225+
226+
if (restateImage.includes("@")) {
227+
const parts = restateImage.split("@");
228+
restateImage = parts[0];
229+
shaDigest = parts[1];
230+
useShaDigest = true;
231+
} else if (restateImage.includes(":")) {
232+
const parts = restateImage.split(":");
233+
restateImage = parts[0];
234+
const inlineTag = parts[1];
235+
236+
if (props.restateTag && props.restateTag !== inlineTag) {
237+
throw new Error(
238+
`Tag conflict: inline tag '${inlineTag}' in image doesn't match explicit tag '${props.restateTag}' property`,
239+
);
240+
}
241+
242+
restateDockerTag = inlineTag;
243+
}
218244
const adotTag = props.adotTag ?? ADOT_DOCKER_DEFAULT_TAG;
219245

220246
this.tlsEnabled = props.tlsTermination === TlsTermination.ON_HOST_SELF_SIGNED_CERTIFICATE;
@@ -231,7 +257,7 @@ export class SingleNodeRestateDeployment extends Construct implements IRestateEn
231257
const initScript = ec2.UserData.forLinux();
232258
initScript.addCommands(
233259
"set -euf -o pipefail",
234-
`yum install -y npm && npm install -gq @restatedev/restate@${restateTag} @restatedev/restatectl@${restateTag}`,
260+
`yum install -y npm && npm install -gq @restatedev/restate@${restateNpmTag} @restatedev/restatectl@${restateNpmTag}`,
235261
"yum install -y docker",
236262
this.mountDataVolumeScript(),
237263

@@ -254,7 +280,7 @@ export class SingleNodeRestateDeployment extends Construct implements IRestateEn
254280
" --network=host" +
255281
` ${envArgs}` +
256282
` --log-driver=awslogs --log-opt awslogs-group=${logGroup.logGroupName}` +
257-
` ${restateImage}:${restateTag}` +
283+
` ${useShaDigest ? `${restateImage}@${shaDigest}` : `${restateImage}:${restateDockerTag}`}` +
258284
" --config-file /etc/restate/config.toml",
259285
);
260286

@@ -358,6 +384,7 @@ export class SingleNodeRestateDeployment extends Construct implements IRestateEn
358384
` "admin",`,
359385
` "metadata-server",`,
360386
` "log-server",`,
387+
` "http-ingress",`,
361388
`]`,
362389
`node-name = "restate-0"`,
363390
`cluster-name = "${props.restateConfig?.clusterName ?? id}"`,

0 commit comments

Comments
 (0)