Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rebrand fullstack-network-manager as Solo #719

Merged
merged 10 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/flow-deploy-release-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ jobs:
npm install -g marked-mangle@1.0.1 marked-gfm-heading-id@3.0.4 semantic-release-conventional-commits@3.0.0

- name: Install Dependencies
working-directory: fullstack-network-manager
working-directory: solo
run: npm ci

- name: Setup NPM Authentication
working-directory: fullstack-network-manager
working-directory: solo
run: |
# create .npmrc file to publish fullstack-network-manager to Github NPM registry
# create .npmrc file to publish solo to Github NPM registry
rm -f .npmrc || true
echo '//npm.pkg.github.com/:_authToken=${NPM_TOKEN}' > ".npmrc"
echo '@hashgraph:registry=https://npm.pkg.github.com' >> ".npmrc"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/flow-pull-request-checks.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##
# Copyright (C) 2023 Hedera Hashgraph, LLC
# Copyright (C) 2023-2024 Hedera Hashgraph, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,9 +65,9 @@ jobs:
with:
custom-job-label: Standard

fsnetman-tests:
solo-tests:
name: FS Network Manager Tests
uses: ./.github/workflows/zxc-fsnetman-tests.yaml
uses: ./.github/workflows/zxc-solo-tests.yaml
with:
custom-job-label: Standard

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
description: "Custom Job Label:"
type: string
required: false
default: "fsnetman Test"
default: "solo Test"
node-version:
description: "NodeJS Version:"
type: string
Expand All @@ -47,15 +47,15 @@ permissions:

jobs:
test:
name: ${{ inputs.custom-job-label || 'fsnetman Test' }}
name: ${{ inputs.custom-job-label || 'solo Test' }}
runs-on: [ self-hosted, Linux, medium, ephemeral ]
steps:
- name: Get related changed files
id: changed-files
uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 #v42.0.2
with:
files: |
fullstack-network-manager/**
solo/**

- name: List all related changed files
id: check-changed-files
Expand All @@ -68,9 +68,9 @@ jobs:
echo ""
if [ "${{ steps.changed-files.outputs.any_changed }}" == "true" ]; then
echo "run-tests=true" >> "${GITHUB_OUTPUT}"
echo "Executing fsnetman tests...."
echo "Scheduled solo tests...."
else
echo ">> No relevant files are changed. No need to run fsnetman tests"
echo ">> No relevant files are changed. No need to run solo tests"
fi

- name: Checkout Code
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:

- name: NodeJS CLI Unit Tests
id: nodejs-test
working-directory: fullstack-network-manager
working-directory: solo
if: ${{ steps.check-changed-files.outputs.run-tests && !cancelled() && !failure() }}
run: |
which npm
Expand All @@ -132,7 +132,7 @@ jobs:

- name: NodeJS CLI E2E Tests
id: nodejs-test-e2e
working-directory: fullstack-network-manager
working-directory: solo
if: ${{ steps.check-changed-files.outputs.run-tests && !cancelled() && !failure() }}
run: |
npm i
Expand All @@ -145,7 +145,7 @@ jobs:

- name: Output logs
id: nodejs-test-e2e-logs
working-directory: fullstack-network-manager
working-directory: solo
if: ${{ steps.check-changed-files.outputs.run-tests && !cancelled() }}
run: |
cat ~/.fsnetman/logs/fst.log
cat ~/.solo/logs/solo.log
57 changes: 28 additions & 29 deletions solo/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Full Stack Network Manager CLI
# Solo

Full Stack Network Manager (fsnetman) is a CLI tool to manage and deploy a Hedera Network using the FS Helm Charts.
Solo is a CLI tool to manage and deploy a private Hedera Network.

## Install

Expand All @@ -15,40 +15,39 @@ Full Stack Network Manager (fsnetman) is a CLI tool to manage and deploy a Heder
your [Github access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)
and setup an environment variable GITHUB\_TOKEN.

* Run `npm install -g @hashgraph/fullstack-network-manager`
* Run `npm install -g @hashgraph/solo`

* Ensure you have a valid kubernetes context, cluster and namespace. You may use `kind` and `kubectl` CLIs to create
cluster and namespace as below (See [`test/e2e/setup-e2e.sh`](test/e2e/setup_e2e.sh)):

```
export FST_CLUSTER_NAME=fst-local
export FST_NAMESPACE=fst-local
kind create cluster -n "${FST_CLUSTER_NAME}"
kubectl create ns "${FST_NAMESPACE}"
fsnetman init -d ../charts --namespace "${FST_NAMESPACE}" # cache args for subsequent commands
export SOLO_CLUSTER_NAME=solo-local
export SOLO_NAMESPACE=solo-local
kind create cluster -n "${SOLO_CLUSTER_NAME}"
kubectl create ns "${SOLO_NAMESPACE}"
solo init -d ../charts --namespace "${SOLO_NAMESPACE}" # cache args for subsequent commands
```

* Run `fsnetman` from a terminal, It may show usage options as shown below:
* Run `solo` from a terminal, It may show usage options as shown below:

```
❯ fsnetman

-------------------------------------------------------------------------------
*** Fullstack Network Manager (FsNetMan) ***
Version : 0.16.0
Kubernetes Context : kind-fst-local
Kubernetes Cluster : kind-fst-local
-------------------------------------------------------------------------------

❯ solo

******************************* Solo *********************************************
Version : 0.18.0
Kubernetes Context : kind-kind
Kubernetes Cluster : kind-kind
Kubernetes Namespace : undefined
**********************************************************************************
Usage:
fsnetman <command> [options]
solo <command> [options]

Commands:
fsnetman init Perform dependency checks and initialize local environment
fsnetman cluster Manage cluster
fsnetman chart Manage chart deployment
fsnetman node Manage a node running Hedera platform
fsnetman relay Manage JSON RPC relays
solo init Initialize local environment
solo cluster Manage fullstack testing cluster
solo network Manage fullstack testing network deployment
solo node Manage Hedera platform node in fullstack testing network
solo relay Manage JSON RPC relays in fullstack testing network

Options:
--dev Enable developer mode [boolean] [default: false]
Expand All @@ -67,12 +66,12 @@ Select a command
* `Run->Edit Configurations->Edit Configuration Templates->Jest` and then set `--experimental-vm-modules`
in `Node Options`.
* Run `npm i` to install the required packages
* Run `npm link` to install `fsnetman` as the CLI
* Note: you need to do it once. If `fsnetman` already exists in your path, you will need to remove it first.
* Alternative way would be to run `npm run fsnetman -- <COMMAND> <ARGS>`
* Run `npm link` to install `solo` as the CLI
* Note: you need to do it once. If `solo` already exists in your path, you will need to remove it first.
* Alternative way would be to run `npm run solo -- <COMMAND> <ARGS>`
* Run `npm test` or `npm run test` to run the unit tests
* Run `fsnetman` to access the CLI as shown above.
* Note that debug logs are stored at `~/.fsnetman/logs/fst.log`. So you may use `tail -f ~/.fsnetman/logs/fst.log | jq
* Run `solo` to access the CLI as shown above.
* Note that debug logs are stored at `~/.solo/logs/solo.log`. So you may use `tail -f ~/.solo/logs/solo.log | jq
` in a separate terminal to keep an eye on the logs.
* Before making a commit run `npm run format`

Expand Down
6 changes: 3 additions & 3 deletions solo/package-lock.json

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

19 changes: 10 additions & 9 deletions solo/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{
"name": "@hashgraph/fullstack-network-manager",
"name": "@hashgraph/solo",
"version": "0.18.0",
"description": "Fullstack-Network-Manager is a CLI tool to manage and deploy a Hedera Network using Helm chart for local testing.",
"description": "Solo is a CLI tool to manage and deploy a private Hedera Network.",
"main": "src/index.mjs",
"type": "module",
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"bin": {
"fsnetman": "fsnetman.mjs"
"solo": "solo.mjs"
},
"scripts": {
"test": "NODE_OPTIONS=--experimental-vm-modules jest --runInBand --detectOpenHandles --forceExit --testPathIgnorePatterns=\".*/e2e/.*\"",
"test-e2e": "NODE_OPTIONS=--experimental-vm-modules jest --runInBand --detectOpenHandles --forceExit --testPathIgnorePatterns=\\\".*/unit/.*\\\"",
"fsnetman": "NODE_OPTIONS=--experimental-vm-modules node fsnetman.mjs",
"solo": "NODE_OPTIONS=--experimental-vm-modules node solo.mjs",
"check": "remark . --quiet --frail && eslint .",
"format": "remark . --quiet --frail --output && eslint --fix ."
},
"keywords": [
"fullstack-network-manager",
"full-stack-testing"
"solo",
"full-stack-testing",
"fullstack-network-manager"
],
"author": "Lenin Mehedy",
"author": "Swirlds Labs",
"license": "Apache2.0",
"dependencies": {
"@hashgraph/sdk": "^2.40.0",
Expand Down Expand Up @@ -57,8 +58,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/hashgraph/full-stack-testing.git",
"directory": "fullstack-network-manager"
"url": "git+https://github.com/hashgraph/solo.git",
"directory": "solo"
},
"os": [
"darwin",
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions solo/src/commands/cluster.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ClusterCommand extends BaseCommand {

self.logger.debug('Prepare ctx.config', { config: ctx.config, argv })

ctx.isChartInstalled = await this.chartManager.isChartInstalled(ctx.config.namespace, constants.CHART_FST_SETUP_NAME)
ctx.isChartInstalled = await this.chartManager.isChartInstalled(ctx.config.namespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
}
},
{
Expand All @@ -94,7 +94,7 @@ export class ClusterCommand extends BaseCommand {
skip: (ctx, _) => ctx.isChartInstalled
},
{
title: `Install '${constants.CHART_FST_SETUP_NAME}' chart`,
title: `Install '${constants.FULLSTACK_CLUSTER_SETUP_CHART}' chart`,
task: async (ctx, _) => {
const namespace = ctx.config.namespace
const version = ctx.config.version
Expand All @@ -103,12 +103,12 @@ export class ClusterCommand extends BaseCommand {
const valuesArg = ctx.valuesArg

try {
await self.chartManager.install(namespace, constants.CHART_FST_SETUP_NAME, chartPath, version, valuesArg)
await self.chartManager.install(namespace, constants.FULLSTACK_CLUSTER_SETUP_CHART, chartPath, version, valuesArg)
} catch (e) {
// if error, uninstall the chart and rethrow the error
self.logger.debug(`Error on installing ${constants.CHART_FST_SETUP_NAME}. attempting to rollback by uninstalling the chart`, e)
self.logger.debug(`Error on installing ${constants.FULLSTACK_CLUSTER_SETUP_CHART}. attempting to rollback by uninstalling the chart`, e)
try {
await self.chartManager.uninstall(namespace, constants.CHART_FST_SETUP_NAME)
await self.chartManager.uninstall(namespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
} catch (ex) {
// ignore error during uninstall since we are doing the best-effort uninstall here
}
Expand Down Expand Up @@ -155,14 +155,14 @@ export class ClusterCommand extends BaseCommand {
namespace
}

ctx.isChartInstalled = await this.chartManager.isChartInstalled(ctx.config.namespace, constants.CHART_FST_SETUP_NAME)
ctx.isChartInstalled = await this.chartManager.isChartInstalled(ctx.config.namespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
}
},
{
title: `Uninstall '${constants.CHART_FST_SETUP_NAME}' chart`,
title: `Uninstall '${constants.FULLSTACK_CLUSTER_SETUP_CHART}' chart`,
task: async (ctx, _) => {
const namespace = ctx.config.namespace
await self.chartManager.uninstall(namespace, constants.CHART_FST_SETUP_NAME)
await self.chartManager.uninstall(namespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
await self.showInstalledChartList(namespace)
},
skip: (ctx, _) => !ctx.isChartInstalled
Expand Down
2 changes: 1 addition & 1 deletion solo/src/commands/flags.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const cacheDir = {
definition: {
describe: 'Local cache directory containing platform release artifacts',
alias: 'd',
default: core.constants.FST_CACHE_DIR,
default: core.constants.SOLO_CACHE_DIR,
type: 'string'
}
}
Expand Down
6 changes: 3 additions & 3 deletions solo/src/commands/init.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export class InitCommand extends BaseCommand {
* @param dirs a list of directories that need to be created in sequence
*/
setupHomeDirectory (dirs = [
constants.FST_HOME_DIR,
constants.FST_LOGS_DIR,
constants.FST_CACHE_DIR
constants.SOLO_HOME_DIR,
constants.SOLO_LOGS_DIR,
constants.SOLO_CACHE_DIR
]) {
const self = this

Expand Down
Loading
Loading