-
Notifications
You must be signed in to change notification settings - Fork 13
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
Improve CLI operations #20
Comments
Hi @mcopik! I am interested in this issue. Can you provide some suggestion on how to get started and reproduce it? Thanks |
heyy!! @mcopik , I'm interested in this issue. |
@afzal442 @shailendrasingh117 Glad to hear you're interested! Right now, if you use our CLI tool
Where both
Our behavior should be similar to ZooKeeper. Right now, we take the arguments provided by the user, convert them to Python values, and call the |
Hello @mcopik ! so instead of boolean args, a user can pass |
@afzal442 Correct! right now, we want to support |
# Python types
args_map = {
"path": str,
"data": bytes,
"ephemeral": bool,
"sequence": bool,
}
# Convert the arguments to the appropriate Python types
kwargs = {}
for arg in args:
if arg in ("-e", "--ephemeral"):
kwargs["ephemeral"] = True
elif arg in ("-s", "--sequence"):
kwargs["sequence"] = True
else:
try:
key, value = arg.split("=")
except ValueError:
click.echo(f"Invalid argument: {arg}")
return client.session_status, client.session_id
if key not in args_map:
click.echo(f"Invalid argument: {key}")
return client.session_status, client.session_id
kwargs[key] = args_map[key](value) |
`
`` |
Hey, I made some changes to the code you provided earlier. Would you mind taking a look and letting me know if everything looks okay? @mcopik |
@afzal442 @shailendrasingh117 Thanks for the contributions! Can you please open a PR with the code changes? I would like to be able to test that :-) |
Hi @mcopik, I opened a PR with some changes. Would you mind taking a look and letting me know if everythink looks ok? |
@THLiu55 Thank you! We're reviewing this with @EricPyZhou and I hope it will be merged soon. |
We implemented FaaSKeeper CLI by mapping user input to function arguments. This is not ideal - for example, we cannot skip some parameters, and we require users to pass "True" and "False" for boolean arguments.
On the other hand, ZooKeeper's commands are much nicer, e.g.
create -e /ephemeral_node mydata
instead of us usingTrue
for the ephemeral parameter.The text was updated successfully, but these errors were encountered: