Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Archive and Update project command #24

Merged
merged 6 commits into from
Feb 7, 2021

Conversation

pmahindrakar-oss
Copy link
Contributor

@pmahindrakar-oss pmahindrakar-oss commented Jan 31, 2021

Archive and Update project command

Usage
1] Added new command named update
Test Output:

bin/flytectl --help
Usage:
   [command]

Available Commands:
  config      Runs various config commands, look at the help of this command to get a list of available commands..
  get         Retrieve various resource.
  help        Help about any command
  update      Update various resources.
  version     Displays version information for the client and server.

2] Added project as available command under update and flags for activate and archive

bin/flytectl update project --help
Retrieves project resources.

Usage:
   update project [flags]

Aliases:
  project, projects

Flags:
  -t, --activateProject   Activates the project specified as argument.
  -a, --archiveProject    Archives the project specified as argument.
  -h, --help              help for project

3] No project Input

bin/flytectl update project
INFO[0000] Using config file: [config.yaml]             
Project  not found

4] Without update options

 bin/flytectl update project -p flytesnacks
INFO[0000] Using config file: [config.yaml]             
Invalid state passed. Specify either activate or archive

5] Archive a project

bin/flytectl update project -p flytesnacks --archive
INFO[0000] Using config file: [config.yaml]             
INFO[0000] Config section [root] updated. No update handler registered.  src="viper.go:318"
INFO[0000] Config section [logger] updated. Firing updated event.  src="viper.go:320"
{"json":{"src":"viper.go:320"},"level":"info","msg":"Config section [admin] updated. Firing updated event.","ts":"2021-01-29T17:17:25+05:30"}
{"json":{"src":"viper.go:318"},"level":"info","msg":"Config section [update] updated. No update handler registered.","ts":"2021-01-29T17:17:25+05:30"}
{"json":{"src":"viper.go:318"},"level":"info","msg":"Config section [adminutils] updated. No update handler registered.","ts":"2021-01-29T17:17:25+05:30"}
{"json":{"src":"client.go:29"},"level":"info","msg":"Initialized Admin client","ts":"2021-01-29T17:17:25+05:30"}
Project flytesnacks updated to ARCHIVED state

6] Output after archival from get command

bin/flytectl  get project 
| ID            | NAME          | DESCRIPTION               |
 --------------- --------------- --------------------------- 
| flyteexamples | flyteexamples | flyteexamples description |
| flytetester   | flytetester   | flytetester description   |

7] Activate project

bin/flytectl update project -p flytesnacks --activateProject
INFO[0000] Using config file: [config.yaml]             
INFO[0000] Config section [adminutils] updated. No update handler registered.  src="viper.go:318"
INFO[0000] Config section [root] updated. No update handler registered.  src="viper.go:318"
INFO[0000] Config section [logger] updated. Firing updated event.  src="viper.go:320"
{"json":{"src":"viper.go:320"},"level":"info","msg":"Config section [admin] updated. Firing updated event.","ts":"2021-01-29T17:18:10+05:30"}
{"json":{"src":"viper.go:318"},"level":"info","msg":"Config section [update] updated. No update handler registered.","ts":"2021-01-29T17:18:10+05:30"}
{"json":{"src":"client.go:29"},"level":"info","msg":"Initialized Admin client","ts":"2021-01-29T17:18:10+05:30"}
Project flytesnacks updated to ACTIVE state

8] Output post activation

bin/flytectl  get project 
| ID            | NAME          | DESCRIPTION               |
 --------------- --------------- --------------------------- 
| flyteexamples | flyteexamples | flyteexamples description |
| flytesnacks   | flytesnacks   | flytesnacks description   |
| flytetester   | flytetester   | flytetester description   |
3 rows

9] Project not found

bin/flytectl update project -p invalidproject --activate
Project invalidproject failed to get updated to ACTIVE state due to rpc error: code = NotFound desc = entry not found

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

How did you fix the bug, make the feature etc. Link to any design docs etc

Tracking Issue

Not found. Will create one.
https://github.com/lyft/flyte/issues/

Follow-up issue

NA
OR
https://github.com/lyft/flyte/issues/

cmd/update/update.go Outdated Show resolved Hide resolved
cmd/update/config.go Outdated Show resolved Hide resolved
@kumare3
Copy link
Contributor

kumare3 commented Feb 6, 2021

Once you rebase on #22 +1 from me

@@ -4,12 +4,13 @@ A local cluster can be setup via --> https://lyft.github.io/flyte/administrator/

Then, if having trouble connecting to local cluster see the following:


#1) Find/Set/Verify gRPC port for your local Flyte service:

FLYTECTL_GRPC_PORT=`kubectl get service -n flyte flyteadmin -o json | jq '.spec.ports[] | select(.name=="grpc").port'`
Copy link
Contributor

Choose a reason for hiding this comment

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

This just needs the envoy ingress now.

@kumare3 kumare3 merged commit 4841ee7 into flyteorg:master Feb 7, 2021
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