Skip to content

Commit

Permalink
Merge pull request #86 from orbs-network/deployment_manifest
Browse files Browse the repository at this point in the history
Deployment manifest
  • Loading branch information
ronnno authored Dec 7, 2021
2 parents 08e2ff6 + 94090c3 commit 0edbf80
Show file tree
Hide file tree
Showing 31 changed files with 666 additions and 617 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ The service is packaged as a Docker image. It is routinely published from this r
| `EthereumGenesisContract` | The hex address (including the leading `0x`) of the Ethereum registry contract used as genesis for all management events. Provide the address of the original contract during the launch of the network.<br>Default: `0xD859701C81119aB12A1e62AF6270aD2AE05c7AB3` (Orbs PoS V2 mainnet) |
| `EthereumFirstBlock` | Optimization. The earliest block number in Ethereum we can start scanning from (the block number when the genesis registry contract was deployed for example).<br>Default: `11191390` (Orbs PoS V2 mainnet) |
| `EthereumEndpoint` | HTTP URL endpoint for an Ethereum full node which will be used for all Ethereum queries. |
| `DockerRegistry` | HTTP URL of the docker registry to rely on.<br>Default: `https://registry.hub.docker.com` |
| `DockerNamespace` | Namespace for images under the docker registry, for example [`orbsnetwork`](https://hub.docker.com/repository/docker/orbsnetwork/node).<br>Default: `orbsnetwork` |
| `ElectionsAuditOnly` | Whether the node is audit only and should avoid joining the committee as elected validator and remain standby in the topology instead.<br>Default: `false` |
| `DeploymentDescriptorUrl` | Locator of the deployment descriptor for automatic software upgrades.<br>Default: `https://deployment.orbs.network/mainnet.json` |
| `StatusJsonPath` | The local path on disk where status JSON should be written by the service.<br>Default: `./status/status.json` |
| `StatusWriteIntervalSeconds` | How often should the service write status JSON file to disk.<br>Default: `25` (seconds) |
| `DockerHubPollIntervalSeconds` | How often should the docker registry be polled to search for new image versions. In seconds.<br>Default: `180` (3 minutes) |
| `DeploymentDescriptorPollIntervalSeconds` | How often should the docker registry be polled to search for new image versions. In seconds.<br>Default: `180` (3 minutes) |
| `RegularRolloutWindowSeconds` | During gradual rollout of image versions, over how long of a period should regular images (non-hotfix) should be rolled out. In seconds.<br>Default: `86400` (24 hours) |
| `HotfixRolloutWindowSeconds` | During gradual rollout of image versions, over how long of a period should hotfix images (non-regular) should be rolled out. In seconds.<br>Default: `3600` (1 hour) |
| `EthereumPollIntervalSeconds` | How often should Ethereum be polled for new blocks containing events. In seconds.<br>Default: `30` (30 seconds) |
Expand Down
4 changes: 2 additions & 2 deletions e2e/bootstrap/expectations-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const expectationNodeManagement = {
ExternalPort: 7666,
Disabled: false,
DockerConfig: {
Image: 'orbsnetwork/management-service',
Image: 'orbsnetworkstaging/management-service',
Tag: isValidImageVersion,
Pull: true,
},
Expand All @@ -26,7 +26,7 @@ export const expectationNodeManagement = {
Port: 8080,
DockerNamespace: 'orbsnetwork',
StatusWriteIntervalSeconds: 1,
DockerHubPollIntervalSeconds: 1,
DeploymentDescriptorPollIntervalSeconds: 1,
EthereumPollIntervalSeconds: 1,
EthereumFirstBlock: 0,
FinalityBufferBlocks: 10,
Expand Down
8 changes: 4 additions & 4 deletions e2e/bootstrap/expectations-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
isValidTimestamp,
isNonEmptyString,
isPositiveNumber,
isValidImageVersion,
isValidTimeRef,
isValidFullImageName,
} from '../deep-matcher';

export const expectationStatus = {
Expand All @@ -24,7 +24,7 @@ export const expectationStatus = {
CurrentTopology: [],
CurrentImageVersions: {
main: {
'management-service': isValidImageVersion,
'management-service': isValidFullImageName,
},
canary: {},
},
Expand All @@ -49,7 +49,7 @@ export const expectationStatus = {
EthereumEndpoint: `http://ganache:7545`,
DockerNamespace: 'orbsnetwork',
StatusWriteIntervalSeconds: 1,
DockerHubPollIntervalSeconds: 1,
DeploymentDescriptorPollIntervalSeconds: 1,
RegularRolloutWindowSeconds: 2,
HotfixRolloutWindowSeconds: 2,
EthereumPollIntervalSeconds: 1,
Expand All @@ -64,7 +64,7 @@ export const expectationStatus = {
EthereumEndpoint: `http://ganache:7545`,
DockerNamespace: 'orbsnetwork',
StatusWriteIntervalSeconds: 1,
DockerHubPollIntervalSeconds: 1,
DeploymentDescriptorPollIntervalSeconds: 1,
RegularRolloutWindowSeconds: 2,
HotfixRolloutWindowSeconds: 2,
EthereumPollIntervalSeconds: 1,
Expand Down
10 changes: 10 additions & 0 deletions e2e/deep-matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ export function isValidImageVersion(str: string) {
return str && str.startsWith('v') && str.split('.').length == 3;
}

export function isValidFullImageName(str: string) {
if (!str || str.length === 0) return false;

const commaDelimArr = str.split(':');

// TODO check the full form of the reference not just the last

return isValidImageVersion(commaDelimArr[commaDelimArr.length - 1]);
}

export function isValidTimeRef(str: string) {
return str && parseInt(str) > 1400000000;
}
Expand Down
4 changes: 2 additions & 2 deletions e2e/driver.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from 'ava';
import { EthereumTestDriver } from '../src/ethereum/test-driver';
import { dockerComposeTool, getAddressForService, getLogsForService } from 'docker-compose-mocha';
import { dockerComposeTool, getAddressForService } from 'docker-compose-mocha';
import fetch from 'node-fetch';
import { retry } from 'ts-retry-promise';
import { join } from 'path';
Expand All @@ -26,7 +26,7 @@ export class TestEnvironment {
DockerNamespace: 'orbsnetwork',
ElectionsAuditOnly: false,
StatusWriteIntervalSeconds: 1,
DockerHubPollIntervalSeconds: 1,
DeploymentDescriptorPollIntervalSeconds: 1,
RegularRolloutWindowSeconds: 2,
HotfixRolloutWindowSeconds: 2,
EthereumPollIntervalSeconds: 1,
Expand Down
4 changes: 2 additions & 2 deletions e2e/expectations-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const expectationNodeManagement = {
ExternalPort: 7666,
Disabled: false,
DockerConfig: {
Image: 'orbsnetwork/management-service',
Image: 'orbsnetworkstaging/management-service',
Tag: isValidImageVersion,
Pull: true,
},
Expand All @@ -39,7 +39,7 @@ export const expectationNodeManagement = {
Port: 8080,
DockerNamespace: 'orbsnetwork',
StatusWriteIntervalSeconds: 1,
DockerHubPollIntervalSeconds: 1,
DeploymentDescriptorPollIntervalSeconds: 1,
EthereumPollIntervalSeconds: 1,
EthereumFirstBlock: 0,
FinalityBufferBlocks: 10,
Expand Down
9 changes: 5 additions & 4 deletions e2e/expectations-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
isValidTimestamp,
isNonEmptyString,
isPositiveNumber,
isValidFullImageName,
} from './deep-matcher';

export const expectationStatus = {
Expand Down Expand Up @@ -93,8 +94,8 @@ export const expectationStatus = {
],
CurrentImageVersions: {
main: {
'management-service': isValidImageVersion,
node: isValidImageVersion,
'management-service': isValidFullImageName,
node: isValidFullImageName,
},
},
CurrentImageVersionsUpdater: {
Expand Down Expand Up @@ -273,7 +274,7 @@ export const expectationStatus = {
EthereumEndpoint: `http://ganache:7545`,
DockerNamespace: 'orbsnetwork',
StatusWriteIntervalSeconds: 1,
DockerHubPollIntervalSeconds: 1,
DeploymentDescriptorPollIntervalSeconds: 1,
RegularRolloutWindowSeconds: 2,
HotfixRolloutWindowSeconds: 2,
EthereumPollIntervalSeconds: 1,
Expand All @@ -290,7 +291,7 @@ export const expectationStatus = {
EthereumEndpoint: `http://ganache:7545`,
DockerNamespace: 'orbsnetwork',
StatusWriteIntervalSeconds: 1,
DockerHubPollIntervalSeconds: 1,
DeploymentDescriptorPollIntervalSeconds: 1,
RegularRolloutWindowSeconds: 2,
HotfixRolloutWindowSeconds: 2,
EthereumPollIntervalSeconds: 1,
Expand Down
107 changes: 0 additions & 107 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"compression": "^1.7.4",
"cors": "^2.8.5",
"deepmerge": "^4.2.2",
"docker-hub-utils": "^1.10.39",
"express": "^4.17.1",
"lodash": "^4.17.21",
"node-fetch": "^2.6.0",
Expand Down
Loading

0 comments on commit 0edbf80

Please sign in to comment.