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

standalone commands #7296

Merged
merged 2 commits into from
May 18, 2023
Merged

standalone commands #7296

merged 2 commits into from
May 18, 2023

Conversation

guymguym
Copy link
Member

@guymguym guymguym commented May 11, 2023

Explain the changes

  1. Standalone commands
    1. Moved all standalone commands like nsfs to src/cmd/*.
    2. Add src/cmd/api command to send rpc api like the operator api command.
    3. Add also the web+bg+s3+hosted_agents+s3cat commands to src/cmd.
    4. Build single-executable from src/cmd/index with pkg so it can be used to run all the core services.
  2. npm scripts:
    1. Add npm run db* scripts for running postgres on dev env.
    2. add --unhandled-rejections=warn to node commands in npm scripts.
    3. Reorganize npm scripts a bit.
  3. Added docs/standalone.md with build and run instructions.
  4. Fix a small problem in system_store that caused standalone processes to try and connect to the db even if it was not needed.

Issues: Fixed #xxx / Gap #xxx

  1. NA

Testing Instructions:

  1. In docs/standalone.md

@guymguym guymguym added the Standalone Work items needed to run standalone (without kubernetes) label May 12, 2023
@guymguym guymguym force-pushed the guy-p6 branch 2 times, most recently from 266ed55 to 72c4347 Compare May 18, 2023 07:55
Copy link
Contributor

@liranmauda liranmauda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some small comments + Love the cmd api 🙂

const USAGE = `
Usage:

node src/cmd api <api_name> <method_name> [<params>] [options...]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider adding an example here:

Suggested change
node src/cmd api <api_name> <method_name> [<params>] [options...]
node src/cmd api <api_name> <method_name> [<params>] [options...]
for example:
node src/cmd api object_api read_object_mapping_admin '{
"bucket": "name",
"key" : "name",
}'

Comment on lines +72 to +74
system: process.env.CREATE_SYS_NAME,
email: process.env.CREATE_SYS_EMAIL,
password: process.env.CREATE_SYS_PASSWD,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we always have those?

Comment on lines +45 to +46
const http_port = process.env.PORT || '5001';
const https_port = process.env.SSL_PORT || '5443';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe worth moving it to the config.js?
so it will be something like this:

Suggested change
const http_port = process.env.PORT || '5001';
const https_port = process.env.SSL_PORT || '5443';
const http_port = config.PORT;
const https_port =config.SSL_PORT;


db_client.instance().connect();
if (process.env.NOOBAA_LOG_LEVEL) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, maybe move into the config.js?

Signed-off-by: Guy Margalit <guymguym@gmail.com>
Signed-off-by: Guy Margalit <guymguym@gmail.com>
@guymguym
Copy link
Member Author

@liranmauda Thanks for the comments, these are about re-organizing the config/env, which I am very much interested in. But I will postpone this to next PRs. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Standalone Work items needed to run standalone (without kubernetes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants