Skip to content

Endpoints and Evals#35

Merged
zknill merged 3 commits intomasterfrom
zak/endpoints-evals
Jul 12, 2023
Merged

Endpoints and Evals#35
zknill merged 3 commits intomasterfrom
zak/endpoints-evals

Conversation

@zknill
Copy link
Copy Markdown
Contributor

@zknill zknill commented Jul 11, 2023

Add endpoint and eval commands on the CLI

unweave endpoint new <exec-id>
unweave eval new <exec-id>
unweave endpoint attach-eval <endpoint-id> <eval-id>
unweave endpoint check
unweave endpoint check-stauts <check-id>

zknill added 3 commits July 7, 2023 15:05
Create endpoints and evals, and run a check on an endpoint
Trigger and get the status of endpoint checks.
Comment on lines +417 to +426
endpointNewCmd := &cobra.Command{
Use: "new <exec-id>",
Short: "Create a new endpoint in Unweave",
Long: wordwrap.String("Create a new endpoint in Unweave.\n\n"+
"Eg. unweave endpoint new <exec-id>\n\n",
ui.MaxOutputLineLength),
Args: cobra.ExactArgs(1),
Aliases: []string{"new", "n", "create", "c"},
RunE: cmd.EndpointCreate,
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a wip syntax right? I think the way we want to expose this is probably:
unweave endpoint new <endpoint-name> and then unweave deploy <endpoint-name>.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, likely. Once you've got the ERD for this we can hash out the details, and I can make the changes easily 💯

Copy link
Copy Markdown
Contributor

@ernesto-jimenez ernesto-jimenez left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. Code-wise everything looked OK, but I wanted to test things and have been struggling a bit with staging being inaccessible and how to connect to the local env.

}

func (s *EndpointService) List(ctx context.Context, userID, projectID string) ([]types.Endpoint, error) {
uri := fmt.Sprintf("projects/%s/%s/endpoints", userID, projectID)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question: do we have too hard-code URLs in both the client and the server? How do we ensure they are aligned?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the paths are 'hard coded' in the client (cli), and the router's mux.
Right now, we make sure they are aligned by smoke testing / using them

ui.Infof("id: %s", endpoint.ID)
ui.Infof("exec id: %s", endpoint.ExecID)
ui.Infof("http: %s\n", endpoint.HTTPEndpoint)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 tangential idea for the future: we'll probably end-up wanting to provide output in structured formats like JSON.

One small improvement in the future would probably be implementing something like ui.Output(endpoints) and handle the presentation in text/json/something else.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is VERY much a temporary output, to have something, while we work out what's the best something we can print.

@zknill zknill merged commit 26c2eef into master Jul 12, 2023
@zknill zknill deleted the zak/endpoints-evals branch July 12, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants