Skip to content

Commit

Permalink
fix(service/chart): fix forced aborts of long-running computations (#36)
Browse files Browse the repository at this point in the history
* fix: fix forced aborts of long-running computations
Signed-off-by: Sebastian Becker <[email protected]>
  • Loading branch information
sbckr authored Aug 4, 2023
1 parent 08720b4 commit a131ae7
Show file tree
Hide file tree
Showing 42 changed files with 1,395 additions and 716 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### IntelliJ IDEA
.idea/*
**/.idea/*
!/.idea/runConfigurations/
*.iml

Expand Down
2 changes: 1 addition & 1 deletion charts/ephemeral/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021 - for information on the respective copyright owner
# Copyright (c) 2021-2023 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
#
# SPDX-License-Identifier: Apache-2.0
Expand Down
83 changes: 47 additions & 36 deletions charts/ephemeral/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,19 @@ helm install --name my-release -f values.yaml ephemeral

### Discovery Service

| Parameter | Description | Default |
| ------------------------------- | ------------------------------------------------------------ | ---------------------------------- |
| `discovery.image.registry` | Image registry used to pull the Discovery Service image | `ghcr.io` |
| `discovery.image.repository` | Discovery Image name | `carbynestack/ephemeral/discovery` |
| `discovery.image.tag` | Discovery Image tag | `latest` |
| `discovery.image.pullPolicy` | Discovery Image pull policy | `IfNotPresent` |
| `discovery.service.annotations` | Annotations that should be attached to the Discovery service | `[]` |
| `discovery.frontendUrl` | The external base URL of the VCP | \`\` |
| `discovery.master.port` | The port of the master discovery service instance | \`\` |
| Parameter | Description | Default |
| -------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------- |
| `discovery.image.registry` | Image registry used to pull the Discovery Service image | `ghcr.io` |
| `discovery.image.repository` | Discovery Image name | `carbynestack/ephemeral/discovery` |
| `discovery.image.tag` | Discovery Image tag | `latest` |
| `discovery.image.pullPolicy` | Discovery Image pull policy | `IfNotPresent` |
| `discovery.service.annotations` | Annotations that should be attached to the Discovery service | `[]` |
| `discovery.frontendUrl` | The external base URL of the VCP | \`\` |
| `discovery.master.port` | The port of the master discovery service instance | \`\` |
| `discovery.isMaster` | Determines whether the service acts as master or slave | `true` |
| `discovery.slave.connectTimeout` | Timeout to establish the connection to the upstream master Discovery Service | `60s` |
| `discovery.stateTimeout` | Timeout in which the transition to the next state is expected | `60s` |
| `discovery.computationTimeout` | Timeout in which the result of a game's mpc computation is expected | `60s` |

### Network Controller

Expand All @@ -106,30 +110,37 @@ helm install --name my-release -f values.yaml ephemeral

### Ephemeral Service

| Parameter | Description | Default |
| ------------------------------------- | -------------------------------------------------------------------- | ---------------------------------- |
| `ephemeral.image.registry` | Image registry used to pull the Ephemeral Service image | `ghcr.io` |
| `ephemeral.image.repository` | Ephemeral Image name | `carbynestack/ephemeral/ephemeral` |
| `ephemeral.image.tag` | Ephemeral Image tag | `latest` |
| `ephemeral.image.pullPolicy` | Ephemeral Image pull policy | `IfNotPresent` |
| `ephemeral.service.annotations` | Annotations that should be attached to the Ephemeral service | `[]` |
| `ephemeral.minScale` | The minimum amount of pods to keep alive for the application | `1` |
| `ephemeral.resources.requests.cpu` | The requested CPU resources in CPU cores | `100m` |
| `ephemeral.resources.requests.memory` | The requested memory resources | `256Mi` |
| `ephemeral.resources.limits.cpu` | The CPU resource limit in CPU cores | \`\` |
| `ephemeral.amphora.host` | The hostname of the Amphora serivce | `amphora` |
| `ephemeral.amphora.scheme` | The scheme used to access the Amphora serivce | `http` |
| `ephemeral.amphora.path` | The path under which the Amphora serivce is available | `/` |
| `ephemeral.castor.host` | The hostname of the Castor serivce | `castor` |
| `ephemeral.castor.scheme` | The scheme used to access the Castor serivce | `http` |
| `ephemeral.castor.path` | The path under which the Castor serivce is available | `/` |
| `ephemeral.castor.tupleStock` | The number of tuples to hold in stock for each tuple type | `1000` |
| `ephemeral.frontendUrl` | The external base URL of the VCP | \`\` |
| `ephemeral.spdz.prime` | The prime used by SPDZ | \`\` |
| `ephemeral.spdz.rInv` | The rInv used by SPDZ | \`\` |
| `ephemeral.spdz.gfpMacKey` | The macKey for the prime protocol used by SPDZ | \`\` |
| `ephemeral.spdz.gf2nMacKey` | The macKey for the GF(2^n) protocol used by SPDZ | \`\` |
| `ephemeral.spdz.gf2nBitLength` | The Bit length of the GF(2^n) field used by SPDZ | \`\` |
| `ephemeral.spdz.gf2nStorageSize` | The size of GF(2^n) tuples in bytes used by SPDZ | \`\` |
| `ephemeral.spdz.prepFolder` | The directory where SPDZ expects the preprocessing data to be stored | \`Player-Data\` |
| `ephemeral.playerId` | Id of this player | \`\` |
| Parameter | Description | Default |
| --------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------- |
| `ephemeral.knative.activation.timeoutSeconds` | Timout in seconds for the container to respond to the knative activation | `3600` |
| `ephemeral.image.registry` | Image registry used to pull the Ephemeral Service image | `ghcr.io` |
| `ephemeral.image.repository` | Ephemeral Image name | `carbynestack/ephemeral/ephemeral` |
| `ephemeral.image.tag` | Ephemeral Image tag | `latest` |
| `ephemeral.image.pullPolicy` | Ephemeral Image pull policy | `IfNotPresent` |
| `ephemeral.service.annotations` | Annotations that should be attached to the Ephemeral service | `[]` |
| `ephemeral.minScale` | The minimum amount of pods to keep alive for the application | `1` |
| `ephemeral.resources.requests.cpu` | The requested CPU resources in CPU cores | `100m` |
| `ephemeral.resources.requests.memory` | The requested memory resources | `256Mi` |
| `ephemeral.resources.limits.cpu` | The CPU resource limit in CPU cores | \`\` |
| `ephemeral.amphora.host` | The hostname of the Amphora serivce | `amphora` |
| `ephemeral.amphora.scheme` | The scheme used to access the Amphora serivce | `http` |
| `ephemeral.amphora.path` | The path under which the Amphora serivce is available | `/` |
| `ephemeral.castor.host` | The hostname of the Castor serivce | `castor` |
| `ephemeral.castor.scheme` | The scheme used to access the Castor serivce | `http` |
| `ephemeral.castor.path` | The path under which the Castor serivce is available | `/` |
| `ephemeral.castor.tupleStock` | The number of tuples to hold in stock for each tuple type | `1000` |
| `ephemeral.discovery.host` | The host address of the discovery service | `discovery.default.svc.cluster.local` |
| `ephemeral.discovery.port` | The port of the discovery service | `8080` |
| `ephemeral.discovery.connectTimout` | Timeout to establish the connection to the discovery service | `60s` |
| `ephemeral.frontendUrl` | The external base URL of the VCP | \`\` |
| `ephemeral.spdz.prime` | The prime used by SPDZ | \`\` |
| `ephemeral.spdz.rInv` | The rInv used by SPDZ | \`\` |
| `ephemeral.spdz.gfpMacKey` | The macKey for the prime protocol used by SPDZ | \`\` |
| `ephemeral.spdz.gf2nMacKey` | The macKey for the GF(2^n) protocol used by SPDZ | \`\` |
| `ephemeral.spdz.gf2nBitLength` | The Bit length of the GF(2^n) field used by SPDZ | \`\` |
| `ephemeral.spdz.gf2nStorageSize` | The size of GF(2^n) tuples in bytes used by SPDZ | \`\` |
| `ephemeral.spdz.prepFolder` | The directory where SPDZ expects the preprocessing data to be stored | \`Player-Data\` |
| `ephemeral.playerId` | Id of this player | \`\` |
| `ephemeral.networkEstablishTimeout` | Timeout to establish network connections | `1m` |
| `ephemeral.player.stateTimeout` | Timeout in which the transition to the next state is expected | `60s` |
| `ephemeral.player.computationTimeout` | Timeout in which the result of a game's mpc computation is expected | `60s` |
7 changes: 5 additions & 2 deletions charts/ephemeral/templates/discovery.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021 - for information on the respective copyright owner
# Copyright (c) 2021-2023 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
#
# SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -75,7 +75,10 @@ data:
"masterHost": "{{ .Values.discovery.master.host }}",
"masterPort": "{{ .Values.discovery.master.port }}",
"slave": {{ if .Values.discovery.isMaster }}false{{ else }}true{{ end }},
"playerCount": {{ .Values.playerCount }}
"playerCount": {{ .Values.playerCount }},
"stateTimeout": "{{ .Values.discovery.stateTimeout }}",
"computationTimeout": "{{ .Values.discovery.computationTimeout }}",
"connectTimeout": "{{ .Values.discovery.slave.connectTimeout }}"
}
---
apiVersion: networking.istio.io/v1alpha3
Expand Down
15 changes: 11 additions & 4 deletions charts/ephemeral/templates/ephemeral.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021 - for information on the respective copyright owner
# Copyright (c) 2021-2023 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
#
# SPDX-License-Identifier: Apache-2.0
Expand All @@ -18,6 +18,7 @@ spec:
{{- end}}
autoscaling.knative.dev/minScale: "{{ .Values.ephemeral.minScale }}"
spec:
timeoutSeconds: {{ .Values.ephemeral.knative.activation.timeoutSeconds }}
{{- if .Values.ephemeral.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.ephemeral.image.pullSecrets }}
Expand Down Expand Up @@ -72,7 +73,7 @@ data:
config.json: |-
{
"retrySleep": "50ms",
"retryTimeout": "1m",
"networkEstablishTimeout": "{{ .Values.ephemeral.networkEstablishTimeout }}",
"prime": "{{ .Values.ephemeral.spdz.prime }}",
"rInv": "{{ .Values.ephemeral.spdz.rInv }}",
"gfpMacKey": "{{ .Values.ephemeral.spdz.gfpMacKey }}",
Expand All @@ -92,7 +93,13 @@ data:
"tupleStock": {{ .Values.ephemeral.castor.tupleStock }}
},
"frontendURL": "{{ .Values.ephemeral.frontendUrl }}",
"discoveryAddress": "{{ .Values.ephemeral.discoveryAddress }}",
"discoveryConfig": {
"host": "{{ .Values.ephemeral.discovery.host }}",
"port": "{{ .Values.ephemeral.discovery.port }}",
"connectTimeout": "{{ .Values.ephemeral.discovery.connectTimeout }}"
},
"playerID": {{ .Values.ephemeral.playerId }},
"playerCount": {{ .Values.playerCount }}
"playerCount": {{ .Values.playerCount }},
"stateTimeout": "{{ .Values.ephemeral.player.stateTimeout }}",
"computationTimeout": "{{ .Values.ephemeral.player.computationTimeout }}"
}
18 changes: 16 additions & 2 deletions charts/ephemeral/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021 - for information on the respective copyright owner
# Copyright (c) 2021-2023 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/ephemeral.
#
# SPDX-License-Identifier: Apache-2.0
Expand All @@ -22,10 +22,17 @@ discovery:
master:
host:
port:
stateTimeout : "60s"
computationTimeout : "600s"
slave:
connectTimeout: "60s"

ephemeral:
service:
annotations: []
knative:
activation:
timeoutSeconds: 3600
image:
registry: ghcr.io
repository: carbynestack/ephemeral/ephemeral
Expand All @@ -49,8 +56,12 @@ ephemeral:
path: "/"
tupleStock: 1000
frontendUrl:
discoveryAddress: discovery.default.svc.cluster.local
discovery:
host: discovery.default.svc.cluster.local
port: 8080
connectTimeout: "60s"
playerId:
networkEstablishTimeout: "1m"
spdz:
prime:
rInv:
Expand All @@ -59,6 +70,9 @@ ephemeral:
gf2nBitLength:
gf2nStorageSize:
prepFolder: "Player-Data"
player:
stateTimeout: "60s"
computationTimeout: "600s"

networkController:
image:
Expand Down
Loading

0 comments on commit a131ae7

Please sign in to comment.