Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

[tem-1559] instance deploy #30

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

mkrisher
Copy link
Contributor

@mkrisher mkrisher commented Oct 28, 2023

This PR introduces the instance deploy command.

 ~/projects/tembo-cli/ [tem-1559-instance-deploy]
cr -- instance create -n my_instance
15:55:12 [INFO] Checking requirements: [Docker]
15:55:12 [INFO] Docker was found and appears running
15:55:12 [INFO] Instance config persisted in config file
15:55:12 [INFO] Instance configuration created, you can start the instance using the command 'tembo start -i <name>'

 ~/projects/tembo-cli/ [tem-1559-instance-deploy]
cr -- instance deploy -n my_instance
15:55:24 [INFO] finding config for instance my_instance
15:55:25 [INFO] provisioning: https://cloud.tembo.io/orgs/org_2TS6bzrPtZTCJR4701S1B4G85Lt/clusters
15:55:25 [INFO]  instance deployed

thanks to @ChuckHend for helping me confirm the required attributes!


let config = Config::new(args, &Config::full_path(args));
if config.cloud_account.is_none() || config.jwt.is_none() {
return Err(Box::new(DockerError::new(
Copy link
Member

Choose a reason for hiding this comment

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

Does this only run in Docker? If not that Docker error could maybe be confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a good point, this isn't running in Docker (rather locally) and could use its own error object, maybe ConfigError? Thoughts?

@@ -48,6 +48,17 @@ instances can be started that share a port number.

Each instance runs as a Docker container.

## `tembo instance stop`

The `instance stop` command allows users to stop their running instances. It requires the name as a parameter.
Copy link
Member

Choose a reason for hiding this comment

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

Is this local only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the only command that hits the cloud is the instance deploy command at this point

let jwt = config.jwt.unwrap();

let client = reqwest::blocking::Client::new();
let request_url = format!("https://api.tembo.io/api/v1/orgs/{org_id}/instances");
Copy link
Member

Choose a reason for hiding this comment

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

Will this be configurable in the future? I could definitely see the need to run our cli against our lower environments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's a good thought, I don't know, the current thinking was to go through the API for everything, what did you have in mind?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants