Release with version.

This commit is contained in:
ravinsp
2022-06-19 00:52:34 +05:30
parent f5c366fbd6
commit e08d012efb
4 changed files with 16 additions and 9 deletions

View File

@@ -12,12 +12,17 @@ Docker image containing cross-platform cluster management scripts.
### Local build
```
cd docker
docker build -t hpdevkit .
docker build -t evernodedev/hpdevkit .
```
### Push to Docker hub
```
docker push evernodedev/hpdevkit
```
### Run
```
docker run -it --rm --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock hpdevkit cluster create 2
docker run -it --rm --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock evernodedev/hpdevkit cluster create 2
```
## Windows build
@@ -83,5 +88,5 @@ The executable can be distributed to be run as a CLI tool on developer machine.
| HP_CLUSTER | Name of the cluster. Can be used to spin up different clusters for different applications. | `default` |
| HP_CLUSTER_SIZE | Number of nodes in the cluster. Applied with 'deploy' command. | `1` |
| HP_DEFAULT_NODE | The node the 'deploy' command uses to display logs. | `1` |
| HP_DEVKIT_IMAGE | Docker image to be used for devkit cluster management. | `hpdevkit` |
| HP_DEVKIT_IMAGE | Docker image to be used for devkit cluster management. | `evernodedev/hpdevkit` |
| HP_INSTANCE_IMAGE | Docker image to be used for Hot Pocket instances. | `evernodedev/hotpocket:latest-ubt.20.04-njs.16` |

View File

@@ -1,6 +1,7 @@
# This image contains scripts for creating Hot Pocket contract clusters
# on the developer machine for local development testing.
# docker build -t hpdevkit .
# docker build -t evernodedev/hpdevkit .
# docker push evernodedev/hpdevkit
FROM ubuntu:focal as builder
RUN apt-get update && apt-get install -y wget

View File

@@ -136,7 +136,7 @@ function bind_mesh {
let peer_port=22860+$i
let user_port=8080+$i
jq ".contract.id=$contract_id | .mesh.port=$peer_port | .user.port=$user_port" $cfg_file > $cfg_file.tmp \
jq ".contract.id=$contract_id | .contract.roundtime=2000 | .mesh.port=$peer_port | .user.port=$user_port" $cfg_file > $cfg_file.tmp \
&& mv $cfg_file.tmp $cfg_file
all_pubkeys[i]=$(jq --raw-output ".node.public_key" $cfg_file)

View File

@@ -1,9 +1,10 @@
$GlobalPrefix = "hpdevkit"
$Version = "0.1.0"
$Cluster = if ($env:HP_CLUSTER) { $env:HP_CLUSTER } else { "default" };
$ClusterSize = if ($env:HP_CLUSTER_SIZE) { $env:HP_CLUSTER_SIZE } else { 1 };
$DefaultNode = if ($env:HP_DEFAULT_NODE) { $env:HP_DEFAULT_NODE } else { 1 };
$DevKitImage = if ($env:HP_DEVKIT_IMAGE) { $env:HP_DEVKIT_IMAGE } else { "hpdevkit" };
$DevKitImage = if ($env:HP_DEVKIT_IMAGE) { $env:HP_DEVKIT_IMAGE } else { "evernodedev/hpdevkit" };
$InstanceImage = if ($env:HP_INSTANCE_IMAGE) { $env:HP_INSTANCE_IMAGE } else { "evernodedev/hotpocket:latest-ubt.20.04-njs.16" };
$VolumeMount = "/$($GlobalPrefix)_vol"
@@ -15,7 +16,6 @@ $DeploymentContainerName = "$($GlobalPrefix)_$($Cluster)_deploymgr"
$CodegenContainerName = "$($GlobalPrefix)_codegen"
$ConfigOverridesFile = "hp.cfg.override"
$CodegenOutputDir = "/codegen-output"
$DefaultCodegenProject = "hpdevkitproject"
function DevKitContainer([string]$Mode, [string]$Name, [switch]$Detached, [switch]$AutoRemove, [switch]$MountSock, [switch]$MountVolume, [string]$EntryPoint, [string]$Cmd, [switch]$Status) {
@@ -142,17 +142,18 @@ Function CodeGenerator() {
docker rm "$($CodegenContainerName)" 2>&1 | Out-Null
}
Write-Host "Hot Pocket devkit launcher ($($Version))"
$Command = $args[0]
$CommandError = "Invalid command. Expected: deploy | clean | start | stop | logs | gen"
if ($Command) {
if ($Command -eq "gen") {
Write-Host "Hot Pocket devkit code generator"
Write-Host "Code generator"
CodeGenerator $args[1] $args[2] $args[3]
}
else {
Write-Host "Hot Pocket devkit launcher"
Write-Host "command: $($Command) (cluster: $($Cluster))"
if ($Command -eq "deploy") {
Deploy -Path $args[1]