Skip to content

Commit

Permalink
feat: removed caching of ConfigManager and its flags (#713)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon authored Oct 21, 2024
1 parent 8d218c1 commit 76a61e3
Show file tree
Hide file tree
Showing 41 changed files with 482 additions and 758 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/autogen/src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function main () {
const templateDir = path.join(outputDir, 'templates')
const configFile = path.join(templateDir, 'config.yaml')
const configData = fs.readFileSync(configFile, 'utf8')
const config = /** @type {Config} **/ yaml.load(configData)
const config = /** @type {Config} **/ yaml.load(configData, {})

// generate the workflows with changes
buildWorkflows(outputDir, templateDir, config)
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/script/update_md.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
set -xeo pipefail
export SOLO_CLUSTER_NAME=solo
export SOLO_NAMESPACE=solo
export SOLO_CLUSTER_SETUP_NAMESPACE=solo-cluster

echo "Perform the following kind and solo commands and save output to environment variables"

kind create cluster -n "${SOLO_CLUSTER_NAME}" 2>&1 | tee create-cluster.log
export KIND_CREATE_CLUSTER_OUTPUT=$( cat create-cluster.log | tee test.log )

solo init | tee init.log
export SOLO_INIT_OUTPUT=$( cat init.log | tee test.log )

solo node keys --gossip-keys --tls-keys -i node1,node2,node3 | tee keys.log
export SOLO_NODE_KEY_PEM_OUTPUT=$( cat keys.log | tee test.log )

solo cluster setup -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" | tee cluster-setup.log
export SOLO_CLUSTER_SETUP_OUTPUT=$( cat cluster-setup.log | tee test.log )

solo network deploy -i node1,node2,node3 -n "${SOLO_NAMESPACE}" | tee network-deploy.log
export SOLO_NETWORK_DEPLOY_OUTPUT=$( cat network-deploy.log | tee test.log )

solo node setup -i node1,node2,node3 -n "${SOLO_NAMESPACE}" | tee node-setup.log
export SOLO_NODE_SETUP_OUTPUT=$( cat node-setup.log | tee test.log )

solo node start -i node1,node2,node3 -n "${SOLO_NAMESPACE}" | tee node-start.log
export SOLO_NODE_START_OUTPUT=$( cat node-start.log | tee test.log )

solo mirror-node deploy -n "${SOLO_NAMESPACE}" | tee mirror-node-deploy.log
export SOLO_MIRROR_NODE_DEPLOY_OUTPUT=$( cat mirror-node-deploy.log | tee test.log )

solo relay deploy -i node1 -n "${SOLO_NAMESPACE}" | tee relay-deploy.log
export SOLO_RELAY_DEPLOY_OUTPUT=$( cat relay-deploy.log | tee test.log )

echo "Generate README.md"

envsubst '$KIND_CREATE_CLUSTER_OUTPUT,$SOLO_INIT_OUTPUT,$SOLO_NODE_KEY_PEM_OUTPUT,$SOLO_CLUSTER_SETUP_OUTPUT, \
$SOLO_NETWORK_DEPLOY_OUTPUT,$SOLO_NODE_SETUP_OUTPUT,$SOLO_NODE_START_OUTPUT,$SOLO_MIRROR_NODE_DEPLOY_OUTPUT,\
$SOLO_RELAY_DEPLOY_OUTPUT'\
< README.md.template > README.md

echo "Remove color codes and lines showing intermediate progress"

sed -i 's/\[32m//g' README.md
sed -i 's/\[33m//g' README.md
sed -i 's/\[39m//g' README.md
egrep -v '↓|❯|•' README.md > README.md.tmp && mv README.md.tmp README.md
set +x
46 changes: 4 additions & 42 deletions .github/workflows/zxc-update-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,55 +110,17 @@ jobs:
- name: Update README.md
run: |
set -x
set -xeo pipefail
npm install
npm run build
npm install -g @hashgraph/solo
npm link
echo "VERSION=${{ inputs.version }}"
[[ -n "${{ inputs.version }}" ]] && npm version ${{ inputs.version }} -f --no-git-tag-version
which solo
export SOLO_CLUSTER_NAME=solo
export SOLO_NAMESPACE=solo
export SOLO_CLUSTER_SETUP_NAMESPACE=solo-cluster
echo "Perform the following kind and solo commands and save output to environment variables"
export KIND_CREATE_CLUSTER_OUTPUT=$( kind create cluster -n "${SOLO_CLUSTER_NAME}" 2>&1 | tee test.log )
export SOLO_INIT_OUTPUT=$( solo init -i node1,node2,node3 -n "${SOLO_NAMESPACE}" -s \
"${SOLO_CLUSTER_SETUP_NAMESPACE}" | tee test.log )
export SOLO_NODE_KEY_PEM_OUTPUT=$( solo node keys --gossip-keys --tls-keys | tee test.log )
export SOLO_CLUSTER_SETUP_OUTPUT=$( solo cluster setup | tee test.log )
export SOLO_NETWORK_DEPLOY_OUTPUT=$( solo network deploy | tee test.log )
export SOLO_NODE_SETUP_OUTPUT=$( solo node setup | tee test.log )
export SOLO_NODE_START_OUTPUT=$( solo node start | tee test.log )
export SOLO_MIRROR_NODE_DEPLOY_OUTPUT=$( solo mirror-node deploy | tee test.log )
export SOLO_RELAY_DEPLAY_OUTPUT=$( solo relay deploy -i node1,node2 | tee test.log )
export SOLO_RELAY_DEPLOY_OUTPUT=$( solo relay deploy | tee test.log )
echo "Generate README.md"
envsubst '$KIND_CREATE_CLUSTER_OUTPUT,$SOLO_INIT_OUTPUT,$SOLO_NODE_KEY_PEM_OUTPUT,$SOLO_CLUSTER_SETUP_OUTPUT, \
$SOLO_NETWORK_DEPLOY_OUTPUT,$SOLO_NODE_SETUP_OUTPUT,$SOLO_NODE_START_OUTPUT,$SOLO_MIRROR_NODE_DEPLOY_OUTPUT,\
$SOLO_RELAY_DEPLAY_OUTPUT,$SOLO_RELAY_DEPLOY_OUTPUT'\
< README.md.template > README.md
echo "Remove color codes and lines showing intermediate progress"
sed -i 's/\[32m//g' README.md
sed -i 's/\[33m//g' README.md
sed -i 's/\[39m//g' README.md
egrep -v '↓|❯|•' README.md > README.md.tmp && mv README.md.tmp README.md
node -p -e "Boolean(process.stdout.isTTY)"
chmod 755 ./.github/workflows/script/update_md.sh
./.github/workflows/script/update_md.sh </dev/null | cat
set +x
- name: Check README.md Changes
Expand Down
45 changes: 1 addition & 44 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
hs_err_pid*
replay_pid*

### NotepadPP template
# Notepad++ backups #
*.bak

### VisualStudioCode template
.vscode/*
!.vscode/settings.json
Expand Down Expand Up @@ -121,11 +117,9 @@ local.properties
#.project

### Backup template
*.bak
*.gho
*.ori
*.orig
*.tmp

### PuTTY template
# Private key
Expand Down Expand Up @@ -157,32 +151,6 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

### Kotlin template
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### OpenSSL template
# OpenSSL-related files best not committed

Expand Down Expand Up @@ -252,9 +220,6 @@ bh_unicode_properties.cache
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings

### MicrosoftOffice template
*.tmp

# Word temporary
~$*.doc*

Expand Down Expand Up @@ -424,7 +389,7 @@ Sessionx.vim

# Temporary
.netrwhist
*~

# Auto-generated tag files
tags
# Persistent undo
Expand All @@ -434,9 +399,6 @@ tags
# It's better to unpack these files and commit the raw source because
# git has its own built in compression methods.
*.7z
*.jar
*.rar
*.zip
*.gz
*.gzip
*.tgz
Expand All @@ -445,7 +407,6 @@ tags
*.bz2
*.xz
*.lzma
*.cab
*.xar

# Packing-only formats
Expand All @@ -459,13 +420,9 @@ tags
*.egg
*.deb
*.rpm
*.msi
*.msm
*.msp
*.txz

### Patch template
*.orig
*.rej

### macOS template
Expand Down
Loading

0 comments on commit 76a61e3

Please sign in to comment.