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

Docker run options. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arthurgreef
Copy link

No description provided.

Copy link
Owner

@tgrospic tgrospic left a comment

Choose a reason for hiding this comment

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

@arthurgreef Thanks for the improvement!

Just one issue that I have with passing string to spawn.

src/rholang-server.ts Show resolved Hide resolved
src/rholang-server.ts Show resolved Hide resolved
this._settings.rnodeDockerImage, ...runCmd('/vscode/.rnode'),
])
]
runOptions && runOptions.length != 0 && cmd.push(`${runOptions}`)
Copy link
Owner

Choose a reason for hiding this comment

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

This is tricky part. spawn accepts arguments separated in a list and not in one string. But just to split by space can also be problematic if space is part of the value.

I wrote helper function to parse arguments by - to an object.
https://github.com/tgrospic/rnode-grpc-js/blob/a6ae689/src/cli/args.js#L30

This is how it's used. For now object can be transformed to a list and just appended. Later we can add merging of objects.
https://github.com/tgrospic/rnode-grpc-js/blob/a6ae6894/src/cli/index.js#L60

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure we can use your function. I have an option like --network=host but your function strips the dashes. I need an array like ['--network', 'host'] not ['network','host']. Am I understanding that you want a modified version of your version to return lists of string arrays with the dashes intact?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, you are right. With equal sign will not work. And also multiple parameters like -p 123 -p 456 are generated as a list for this key { p: [123, 456] }.
Maybe there already exists some nice lib for what we need here?

Copy link

Choose a reason for hiding this comment

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

elsewhere in vs-code config, JSON is used to represent structured args.

@tgrospic tgrospic linked an issue Jun 24, 2020 that may be closed by this pull request
@tgrospic tgrospic added the enhancement New feature or request label Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add docker commands setting option
3 participants