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

feat: add support for flexible lease acquisition and production readiness #830

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
61 changes: 8 additions & 53 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,8 @@
name: Bug Report
description: File a bug report
title: "<Please write a short description of what didn't work for you here>"
#title: "<Please write a short description of what didn't work for you here>"
labels: ["Bug", "Pending Triage"]
body:
- type: input
id: bom-cli-version
attributes:
label: Bill of Materials or CLI Version
description: Which version of the BOM or CLI are you using?
placeholder: |
ex. 0.18.2 or git commit ID

The bill of materials version can be found in your Gradle or Maven
build configuration. The CLI version can be found by using the `--version` switch.
- type: dropdown
id: execution-environment
attributes:
label: Execution Environment
description: Which front-end execution environment are you using?
options:
- JUnit Extensions
- Performance CLI
- Local Node CLI
- Other
validations:
required: true
- type: dropdown
id: logging-implementation
attributes:
label: Slf4j Logging Implementation
description: Which slf4j compatible logging implementation are you using? **JUnit Users Only**
options:
- Log4j 1.x
- Log4j 2.x
- Logback Classic
- Other
validations:
required: false
- type: textarea
id: reproduction-steps
attributes:
label: To Reproduce
description: Steps to reproduce the behavior
render: markdown
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
id: actual-behavior
attributes:
Expand All @@ -67,13 +20,15 @@ body:
validations:
required: true
- type: textarea
id: test-cli-logs
id: reproduction-steps
attributes:
label: Whole JUnit/CLI Logs
description: "NEVER EVER OMIT THIS! Include logs from JUnit test output or CLI console/log file output. Don't omit the parts you think irrelevant!"
render: shell
label: To Reproduce
description: Steps to reproduce the behavior
placeholder: |
PROVIDE THE LOGS VIA A GIST LINK (https://gist.github.com/), NOT DIRECTLY IN THIS TEXT AREA
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/feature_enhancement.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature Enhancement
description: Enhance an existing feature
title: "<Please write a brief description of the feature enhancement here>"
#title: "<Please write a brief description of the feature enhancement here>"
labels: ["Feature Enhancement", "Pending Triage"]
body:
- type: textarea
Expand All @@ -18,7 +18,6 @@ body:
attributes:
label: Requested Enhancement
description: What would you like to enhance or change about this feature?
render: markdown
placeholder: |
_A clear and concise description of what you want to happen._

Expand All @@ -30,7 +29,6 @@ body:
attributes:
label: Business Need
description: Why is this needed?
render: markdown
placeholder: |
_A clear and concise description of any alternative solutions or other features you've considered._

Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: New Feature
description: Request a new feature
title: "<Please write a brief description of the new feature here>"
#title: "<Please write a brief description of the new feature here>"
labels: ["New Feature", "Pending Triage"]
body:
- type: textarea
id: feature-description
attributes:
label: Requested Feature
description: What would you like added?
render: markdown
placeholder: |
_A clear and concise description of what you want to happen._

Expand All @@ -20,7 +19,6 @@ body:
attributes:
label: Business Need
description: Why is this needed?
render: markdown
placeholder: |
_A clear and concise description of any alternative solutions or features you've considered._

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "cross-env MOCHA_SUITE_NAME=\"Unit Tests\" c8 --report-dir='coverage/unit' mocha 'test/unit/**/*.ts' --reporter-options configFile=mocha-multi-reporter.json,cmrOutput=mocha-junit-reporter+mochaFile+junit.xml",
"test-e2e-all": "cross-env MOCHA_SUITE_NAME=\"Mocha E2E All Tests\" c8 --report-dir='coverage/e2e-all' mocha 'test/e2e/**/*.ts' --reporter-options configFile=mocha-multi-reporter.json,cmrOutput=mocha-junit-reporter+mochaFile+junit-e2e-all.xml",
"test-e2e-integration": "cross-env MOCHA_SUITE_NAME=\"Mocha E2E Integration Tests\" c8 --report-dir='coverage/e2e-integration' mocha 'test/e2e/integration/**/*.ts' --reporter-options configFile=mocha-multi-reporter.json,cmrOutput=mocha-junit-reporter+mochaFile+junit-e2e-integration.xml",
"test-e2e-leases": "cross-env MOCHA_SUITE_NAME=\"Mocha E2E Lease Tests\" c8 --report-dir='coverage/e2e-leases' mocha 'test/e2e/integration/core/lease_manager.test.ts' --reporter-options configFile=mocha-multi-reporter.json,cmrOutput=mocha-junit-reporter+mochaFile+junit-e2e-integration.xml",
"test-e2e-leases": "cross-env MOCHA_SUITE_NAME=\"Mocha E2E Lease Tests\" c8 --report-dir='coverage/e2e-leases' mocha 'test/e2e/integration/core/lease*.test.ts' --reporter-options configFile=mocha-multi-reporter.json,cmrOutput=mocha-junit-reporter+mochaFile+junit-e2e-integration.xml",
"test-e2e-standard": "cross-env MOCHA_SUITE_NAME=\"Mocha E2E Standard Tests\" c8 --report-dir='coverage/e2e-standard' mocha 'test/e2e/**/*.ts' --ignore 'test/unit/**/*.ts' --ignore 'test/e2e/integration/**/*.ts' --ignore 'test/e2e/commands/mirror_node*.ts' --ignore 'test/e2e/commands/node*.ts' --ignore 'test/e2e/commands/separate_node*.ts' --ignore 'test/e2e/commands/relay*.ts' --reporter-options configFile=mocha-multi-reporter.json,cmrOutput=mocha-junit-reporter+mochaFile+junit-e2e-standard.xml --timeout 30000",
"test-e2e-mirror-node": "cross-env MOCHA_SUITE_NAME=\"Mocha E2E Mirror Node Tests\" c8 --report-dir='coverage/e2e-mirror-node' mocha 'test/e2e/commands/mirror_node.test.ts' --reporter-options configFile=mocha-multi-reporter.json,cmrOutput=mocha-junit-reporter+mochaFile+junit-e2e-mirror-node.xml",
"test-e2e-node-pem-stop": "cross-env MOCHA_SUITE_NAME=\"Mocha E2E Node PEM Stop Tests\" c8 --report-dir='coverage/e2e-node-pem-stop' mocha 'test/e2e/commands/node_pem_stop.test.ts' --reporter-options configFile=mocha-multi-reporter.json,cmrOutput=mocha-junit-reporter+mochaFile+junit-e2e-node-pem-stop.xml",
Expand Down
6 changes: 4 additions & 2 deletions src/commands/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { constants, type AccountManager } from '../core/index.ts'
import { type AccountId, AccountInfo, HbarUnit, PrivateKey } from '@hashgraph/sdk'
import { FREEZE_ADMIN_ACCOUNT } from '../core/constants.ts'
import { type Opts } from '../types/index.js'
import { ListrLease } from '../core/listr_lease.js'

export class AccountCommand extends BaseCommand {
private readonly accountManager: AccountManager
private accountInfo: {
Expand Down Expand Up @@ -249,7 +251,7 @@ export class AccountCommand extends BaseCommand {

async create (argv: any) {
const self = this
const lease = self.leaseManager.instantiateLease()
const lease = await self.leaseManager.create()

interface Context {
config: {
Expand Down Expand Up @@ -294,7 +296,7 @@ export class AccountCommand extends BaseCommand {

await self.accountManager.loadNodeClient(ctx.config.namespace)

return lease.buildAcquireTask(task)
return ListrLease.newAcquireLeaseTask(lease, task)
}
},
{
Expand Down
5 changes: 3 additions & 2 deletions src/commands/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import { constants } from '../core/index.ts'
import * as prompts from './prompts.ts'
import path from 'path'
import { ListrLease } from '../core/listr_lease.js'

/**
* Define the core functionalities of 'cluster' command
Expand Down Expand Up @@ -163,7 +164,7 @@

async reset (argv: any) {
const self = this
const lease = self.leaseManager.instantiateLease()
const lease = await self.leaseManager.create()

interface Context {
config: {
Expand Down Expand Up @@ -200,7 +201,7 @@
throw new SoloError('No chart found for the cluster')
}

return lease.buildAcquireTask(task)
return ListrLease.newAcquireLeaseTask(lease, task)
}
},
{
Expand Down Expand Up @@ -326,11 +327,11 @@
/**
* Prepare values arg for cluster setup command
*
* @param [chartDir] - local charts directory (default is empty)

Check warning on line 330 in src/commands/cluster.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

tsdoc-param-tag-with-invalid-optional-name: The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets
* @param [prometheusStackEnabled] - a bool to denote whether to install prometheus stack

Check warning on line 331 in src/commands/cluster.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

tsdoc-param-tag-with-invalid-optional-name: The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets
* @param [minioEnabled] - a bool to denote whether to install minio

Check warning on line 332 in src/commands/cluster.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

tsdoc-param-tag-with-invalid-optional-name: The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets
* @param [certManagerEnabled] - a bool to denote whether to install cert manager

Check warning on line 333 in src/commands/cluster.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

tsdoc-param-tag-with-invalid-optional-name: The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets
* @param [certManagerCrdsEnabled] - a bool to denote whether to install cert manager CRDs

Check warning on line 334 in src/commands/cluster.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

tsdoc-param-tag-with-invalid-optional-name: The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets
*/
prepareValuesArg (
chartDir = flags.chartDirectory.definition.defaultValue as string,
Expand All @@ -356,7 +357,7 @@

/**
* Prepare chart path
* @param [chartDir] - local charts directory (default is empty)

Check warning on line 360 in src/commands/cluster.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

tsdoc-param-tag-with-invalid-optional-name: The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets
*/
async prepareChartPath (chartDir = flags.chartDirectory.definition.defaultValue as string) {
let chartPath = 'solo-charts/solo-cluster-setup'
Expand Down
9 changes: 5 additions & 4 deletions src/commands/mirror_node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import * as prompts from './prompts.ts'
import { getFileContents, getEnvValue } from '../core/helpers.ts'
import { type PodName } from '../types/aliases.ts'
import { type Opts } from '../types/index.ts'
import { ListrLease } from '../core/listr_lease.js'

export class MirrorNodeCommand extends BaseCommand {
private readonly accountManager: AccountManager
Expand Down Expand Up @@ -129,7 +130,7 @@ export class MirrorNodeCommand extends BaseCommand {

async deploy (argv: any) {
const self = this
const lease = self.leaseManager.instantiateLease()
const lease = await self.leaseManager.create()

interface MirrorNodeDeployConfigClass {
chartDirectory: string
Expand Down Expand Up @@ -191,7 +192,7 @@ export class MirrorNodeCommand extends BaseCommand {

await self.accountManager.loadNodeClient(ctx.config.namespace)

return lease.buildAcquireTask(task)
return ListrLease.newAcquireLeaseTask(lease, task)
}
},
{
Expand Down Expand Up @@ -350,7 +351,7 @@ export class MirrorNodeCommand extends BaseCommand {

async destroy (argv: any) {
const self = this
const lease = self.leaseManager.instantiateLease()
const lease = await self.leaseManager.create()

interface Context {
config: {
Expand Down Expand Up @@ -393,7 +394,7 @@ export class MirrorNodeCommand extends BaseCommand {

await self.accountManager.loadNodeClient(ctx.config.namespace)

return lease.buildAcquireTask(task)
return ListrLease.newAcquireLeaseTask(lease, task)
}
},
{
Expand Down
13 changes: 7 additions & 6 deletions src/commands/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import fs from 'fs'
import type { CertificateManager, KeyManager, PlatformInstaller, ProfileManager } from '../core/index.ts'
import type { NodeAlias, NodeAliases } from '../types/aliases.ts'
import type { Opts } from '../types/index.ts'
import { ListrLease } from '../core/listr_lease.js'

export interface NetworkDeployConfigClass {
applicationEnv: string
Expand Down Expand Up @@ -230,7 +231,7 @@ export class NetworkCommand extends BaseCommand {
/** Run helm install and deploy network components */
async deploy (argv: any) {
const self = this
const lease = self.leaseManager.instantiateLease()
const lease = await self.leaseManager.create()

interface Context {
config: NetworkDeployConfigClass
Expand All @@ -241,7 +242,7 @@ export class NetworkCommand extends BaseCommand {
title: 'Initialize',
task: async (ctx, task) => {
ctx.config = await self.prepareConfig(task, argv)
return lease.buildAcquireTask(task)
return ListrLease.newAcquireLeaseTask(lease, task)
}
},
{
Expand Down Expand Up @@ -429,7 +430,7 @@ export class NetworkCommand extends BaseCommand {

async destroy (argv: any) {
const self = this
const lease = self.leaseManager.instantiateLease()
const lease = await self.leaseManager.create()

interface Context {
config: {
Expand Down Expand Up @@ -468,7 +469,7 @@ export class NetworkCommand extends BaseCommand {
namespace: self.configManager.getFlag<string>(flags.namespace) as string
}

return lease.buildAcquireTask(task)
return ListrLease.newAcquireLeaseTask(lease, task)
}
},
{
Expand Down Expand Up @@ -522,7 +523,7 @@ export class NetworkCommand extends BaseCommand {
/** Run helm upgrade to refresh network components with new settings */
async refresh (argv: any) {
const self = this
const lease = self.leaseManager.instantiateLease()
const lease = await self.leaseManager.create()

interface Context {
config: NetworkDeployConfigClass
Expand All @@ -533,7 +534,7 @@ export class NetworkCommand extends BaseCommand {
title: 'Initialize',
task: async (ctx, task) => {
ctx.config = await self.prepareConfig(task, argv)
return lease.buildAcquireTask(task)
return ListrLease.newAcquireLeaseTask(lease, task)
}
},
{
Expand Down
Loading
Loading