Compare commits

...

475 Commits

Author SHA1 Message Date
Andrey Melnikov
5a66ef2673 Merge pull request #500 from onepanelio/feat/onepanelio.core.386-migrations.update
feat: Update migrations for maskRCNN, tf od, and cvat
2020-08-14 14:36:21 -07:00
Andrey Melnikov
eabd391180 update: api to 0.12.0-rc.0 2020-08-14 14:35:36 -07:00
Andrey Melnikov
0736c92804 Merge branch 'dev' into feat/onepanelio.core.386-migrations.update 2020-08-14 14:34:20 -07:00
Andrey Melnikov
93551f12ee update: migration templates 2020-08-14 14:27:59 -07:00
Andrey Melnikov
9cb3002cee Merge pull request #512 from onepanelio/feat/add.default.visibility
feat: make default visibility public for parameters
2020-08-14 11:10:25 -07:00
Andrey Melnikov
eb9d798021 feat: make default visibility public for parameters 2020-08-14 10:58:06 -07:00
Andrey Melnikov
a31082d9a1 Merge pull request #510 from onepanelio/bug/auth.crash
fix: issue where auth would sometimes crash
2020-08-13 18:21:37 -07:00
Andrey Melnikov
865f3fa827 fix: issue where auth would sometimes crash 2020-08-13 18:18:43 -07:00
Andrey Melnikov
072cbf24e3 Merge pull request #506 from onepanelio/bug/onepanelio.core.505-panic
fix: issue where creating a workspace with no matching template caused a panic
2020-08-13 14:55:52 -07:00
Andrey Melnikov
90ce50a9ac fix: issue where creating a workspace with no template caused a panic 2020-08-13 14:51:38 -07:00
Andrey Melnikov
00806b9baf Merge pull request #502 from onepanelio/feat/support-script-templates
feat: Support script templates in Workflow
2020-08-13 10:25:53 -07:00
rushtehrani
ce805bfa20 feat: Support script templates in Workflow 2020-08-12 22:31:42 -07:00
Andrey Melnikov
1431b4344b update: added migrations to
* create maskrcnn workflow template
* update tf_od workflow template
* updated cvat workspace template
2020-08-12 11:51:37 -07:00
Andrey Melnikov
9558473f2c feat: handled edge case where auth pieces might be less than 2. 2020-08-12 10:36:25 -07:00
Andrey Melnikov
bc7ce21fb6 chore: update api swagger version to 0.12.0b5. 2020-08-12 10:36:05 -07:00
Andrey Melnikov
e222af5564 Merge pull request #498 from onepanelio/feat/onepanelio.core.470-workspace.template.description.and.labels
feat: added description to workspace templates
2020-08-12 10:21:04 -07:00
Andrey Melnikov
2abe166904 Merge pull request #496 from onepanelio/fix/skip-params-for-sys-volumes
fix: Skip generation volume size parameters for system volumes
2020-08-11 10:14:31 -07:00
Andrey Melnikov
4b4cccbd74 Merge pull request #486 from onepanelio/feat/remove-nvidia-smi-mount
chore: Remove nvidia-smi mount
2020-08-11 10:10:57 -07:00
Andrey Melnikov
eb06f0ada3 Merge pull request #497 from onepanelio/fix/labels.count
fix: bug with counting workflow templates with labels query
2020-08-10 20:09:42 -07:00
Andrey Melnikov
6b74d0c61b fix: issue where counting workflow templates didn't work without the old labels table 2020-08-10 20:06:58 -07:00
Aleksandr Melnikov
d41dad0074 Merge pull request #493 from onepanelio/feat/onepanelio.labels.upgrade
feat: upgrade label structure to support querying with multiple labels
2020-08-10 17:01:19 -07:00
rushtehrani
34f440587f skip param generation for system volumes 2020-08-10 16:14:59 -07:00
Aleksandr Melnikov
70a4fc9eb8 Merge pull request #491 from onepanelio/fix/onepanelio.core-458.workflow.template.name.error
fix: add more useful error message when workflow template name is too long
2020-08-10 15:40:03 -07:00
Andrey Melnikov
cd7f4cb5d7 feat: added description to workspace templates 2020-08-10 15:06:38 -07:00
Andrey Melnikov
6a681e6693 chore: documented JSONLabels and ReplaceLabelsUsingKnownID 2020-08-10 13:01:19 -07:00
Andrey Melnikov
036e417a56 fix: go migration that used old label method. It is no longer needed apart from backwards compatibility support. 2020-08-10 12:00:21 -07:00
Andrey Melnikov
879932c4b5 update: migration to migrate old labels to new labels and roll back 2020-08-10 11:35:42 -07:00
Andrey Melnikov
3c3a514983 update: updated logic to filter workflow templates by labels. It now supports AND so you can filter by multiple labels 2020-08-09 21:04:50 -07:00
Andrey Melnikov
8586639a6c update: cron workflows to use new labels 2020-08-09 16:15:05 -07:00
Andrey Melnikov
55eeb90e2a update: workspace labels during creation, listing, and getting to use new method 2020-08-09 13:57:33 -07:00
Andrey Melnikov
c81c2d7672 update: fixed issues where workspace template version labels were not being correctly set/got. Also updated generic server endpoints with new logic 2020-08-09 13:45:24 -07:00
Andrey Melnikov
2f5720aefc fix: migration for labels - added workspace templates labels 2020-08-09 13:43:50 -07:00
Andrey Melnikov
f02e7791f7 update: updated labels for workflow templates and their versions 2020-08-08 15:56:17 -07:00
Andrey Melnikov
8dc22ff9bc chore: added more descriptive error message when workflow template name is too long 2020-08-07 15:41:27 -07:00
Andrey Melnikov
6edca5731b update: change reader to use bufio for buffered reading 2020-08-07 15:15:25 -07:00
Andrey Melnikov
63bdb69968 fix: issue where scanner could not handle long lines while reading logs 2020-08-07 15:10:55 -07:00
rushtehrani
b2e887c1c9 remove nvidia-smi mount 2020-08-06 14:18:21 -07:00
Andrey Melnikov
88d23a5ec5 Merge pull request #483 from onepanelio/fix/workspace.namespace
fix: issue with migrations failing to run
2020-08-05 14:24:32 -07:00
Andrey Melnikov
97ac5892ab fix: issue where workspaceTemplate namespace was not set before setting service environment variables
These were called from migrations
2020-08-05 14:18:58 -07:00
Andrey Melnikov
18a8164b8e Merge pull request #482 from onepanelio/fix/parameter.display.name
fix: issue where parameter display name was not being parsed correctly
2020-08-05 12:50:11 -07:00
Andrey Melnikov
2d5db5baa1 fix: issue where parameter display name was not being parsed correctly 2020-08-05 12:44:28 -07:00
Andrey Melnikov
c30196f267 Merge pull request #479 from onepanelio/feat/onepanelio.core-476.service.environment.vars
fix: incorrect url generated for service environment variables
2020-08-05 11:06:35 -07:00
Andrey Melnikov
7af2e5b1db update: rename files component -> service 2020-08-05 11:00:32 -07:00
Andrey Melnikov
5e4bbaaf9b fix: issue where updating a workspace template did not correctly update services env vars 2020-08-05 10:59:54 -07:00
Andrey Melnikov
e826167aa5 Merge pull request #477 from onepanelio/feat/onepanelio.core-476.service.environment.vars
feat: added service environment variables to be mounted into workspaces
2020-08-04 15:43:24 -07:00
Andrey Melnikov
6863fd8d99 feat: added service environment variables to be mounted into workspaces 2020-08-04 15:30:55 -07:00
Andrey Melnikov
aed10dc1c9 Merge pull request #475 from onepanelio/fix/core.414-large.artifact.download.crashes.dev
fix: issue where downloading artifact files from a workflow over 10 MB failed
2020-08-04 11:16:32 -07:00
Andrey Melnikov
20c23cfb8e Merge pull request #474 from onepanelio/fix/onepanelio.core.473-fix.workflow.bug
fix: issue where running a workflow execution again failed
2020-08-04 10:47:22 -07:00
Aleksandr Melnikov
4cdb39f934 Updating the max server / client send and receive message size. 2020-08-04 10:46:43 -07:00
Aleksandr Melnikov
10204a8896 Addiing octet-stream to api.proto. 2020-08-04 10:43:08 -07:00
Andrey Melnikov
3e6a48ba1e fix: issue where running a workflow execution again failed. 2020-08-04 10:40:18 -07:00
Andrey Melnikov
aeaa447beb Revert "poc: Using a custom type for labels backed by JSONB"
This reverts commit 023713da32.
2020-08-03 15:26:08 -07:00
Andrey Melnikov
023713da32 poc: Using a custom type for labels backed by JSONB 2020-08-03 15:25:18 -07:00
Aleksandr Melnikov
8a58fb9705 Merge pull request #464 from onepanelio/fix/onepanel.core.463-workflow.template.error
fix: workflow template visibility gave incorrect error
2020-07-31 11:41:26 -07:00
Andrey Melnikov
54d5420838 fix: issue where workflow template parameters error did not correctly propagate back to the client 2020-07-31 11:22:09 -07:00
Andrey Melnikov
ebfcf1fb31 Merge pull request #462 from onepanelio/feat/onepanelio.core.450-refactor.parameters.parsing
chore: simplify logic for parsing parameters from cron workflow manifests
2020-07-31 11:12:28 -07:00
Aleksandr Melnikov
10fb88639c Merge pull request #461 from onepanelio/feat/onepanelio.core.440-parameter.visibility
fix: restricted parameter visibility to not allow any random value
2020-07-31 10:25:08 -07:00
Andrey Melnikov
b020efb16f update: GetParametersFromWorkflowSpec to use yaml unmarshaling 2020-07-30 22:33:00 -07:00
Andrey Melnikov
85e876b723 update: restricted parameter visibility to one of four values
* public
* protected
* internal
* private

Also did a minor cleanup to parameter conversion from v1 to api
2020-07-30 19:01:52 -07:00
Aleksandr Melnikov
080c667b05 Merge pull request #457 from onepanelio/feat/onepanelio.core.440-parameter.visibility
feat: add visibility field to parameters
2020-07-30 13:39:07 -07:00
Andrey Melnikov
fc89727b80 feat: added visibility to parameters 2020-07-30 12:52:03 -07:00
Andrey Melnikov
9b90391892 Merge pull request #448 from onepanelio/bug/db.connection.leak
fix: database connection leak
2020-07-30 11:13:25 -07:00
Andrey Melnikov
e99e66590a fix: fixed issue where ParseParametersFromManifest did not correctly parse integers 2020-07-30 10:58:34 -07:00
Andrey Melnikov
a8f287b197 update: when formatting parameters for API response, if the value is nil, allow it.
Although this technically shouldn't happen, it will help in debugging and preventing crashes.
2020-07-29 22:33:55 -07:00
Andrey Melnikov
7e63fa28d0 fix: issue where nil param values caused dereference errors 2020-07-29 22:27:53 -07:00
Andrey Melnikov
7e41f5e538 fix: issue where db connections were not being closed in go migrations or when configmap changes were detected 2020-07-29 17:43:40 -07:00
Andrey Melnikov
77080ff173 Merge pull request #447 from onepanelio/chore/protoc.updates
chore: update api docs
2020-07-29 16:43:01 -07:00
Andrey Melnikov
8ca18d5fc5 update: regenerate api 2020-07-29 16:40:26 -07:00
Andrey Melnikov
4b7d7a1932 Merge pull request #421 from onepanelio/feat/components
feat: add components API
2020-07-29 16:37:27 -07:00
Aleksandr Melnikov
e244b8e625 Merge pull request #437 from onepanelio/feat/onepanelio.core.391-create.workflow.link
feat: add workflow execution metadata fields
2020-07-29 16:34:15 -07:00
Andrey Melnikov
819c57bed1 Merge pull request #443 from onepanelio/feat/core.387-merge
feat: Adding "parameters" to workflow template API response.
2020-07-29 15:51:04 -07:00
Aleksandr Melnikov
eeaad9c03b Putting back a function lost to merge. 2020-07-29 15:45:29 -07:00
Aleksandr Melnikov
6ca2977662 Adding a comment. 2020-07-29 15:35:35 -07:00
Aleksandr Melnikov
6dd0225e17 Generated proto files. 2020-07-29 15:06:46 -07:00
Aleksandr Melnikov
a26c83988b Fixing functions from merge. 2020-07-29 15:06:37 -07:00
Aleksandr Melnikov
80ed85a4cb Fixing an issue with parameters being null for insert.
- This can happen when editing a workflow template in the UI and hitting
save.
2020-07-29 15:06:26 -07:00
Aleksandr Melnikov
e0f8118241 Merge branch 'dev' into feat/core.387-merge 2020-07-29 14:46:22 -07:00
Andrey Melnikov
da1ca6eece update: rename components to services 2020-07-29 14:21:14 -07:00
Aleksandr Melnikov
b239ca1e6f Merge pull request #439 from onepanelio/feat/onepanelio.core.434-filter.workflow.templates.by.label
feat: add API support to filter workflow templates by a label
2020-07-29 14:15:13 -07:00
Aleksandr Melnikov
b2bef450e1 Merge branch 'dev' into feat/onepanelio.core.434-filter.workflow.templates.by.label 2020-07-29 13:10:05 -07:00
Andrey Melnikov
08442a796f Merge pull request #427 from onepanelio/feat/namespace-config-injector
feat: Mount namespace config for system containers
2020-07-29 12:44:21 -07:00
Aleksandr Melnikov
206e6a48cd Simplifying function calls per feedback. 2020-07-29 12:02:16 -07:00
Aleksandr Melnikov
276708d83c Adding and fixing comments. 2020-07-29 11:52:03 -07:00
Aleksandr Melnikov
9c8299d89c Renaming function per feedback. 2020-07-29 11:24:30 -07:00
Aleksandr Melnikov
828e44ab7d Updating function names per feedback.
- Do not expose DB functions.
2020-07-29 11:19:58 -07:00
Aleksandr Melnikov
98a45f927f Adding wtv.ID <= 0 check, per feedback.
Simplifying the returned err.
2020-07-29 11:19:35 -07:00
Aleksandr Melnikov
c97737773e Removing unnecessary type-cast 2020-07-29 11:15:19 -07:00
Aleksandr Melnikov
57f228ec2c Removing fields that should not be changed. 2020-07-29 11:14:12 -07:00
Aleksandr Melnikov
f421ba4ab8 Simplifying variable initializing. 2020-07-29 11:14:04 -07:00
Aleksandr Melnikov
6d9a575789 Simplifying migration that updates parameters.
- Directly retrieving all the WorkflowTemplateVersions from the database
and updating them, instead of going through namespaces, workflow templates,
then the versions.
2020-07-29 10:45:27 -07:00
Aleksandr Melnikov
0a6ea236c7 Adding functions to select all WorkflowTemplateVersions from the
database without filtering.
2020-07-29 10:44:22 -07:00
Aleksandr Melnikov
fa2a351da3 Removing namespace parameter since updating the database entry does
not require a namespace filter.
2020-07-29 10:42:42 -07:00
Aleksandr Melnikov
7ff17a5aae Refactoring database code.
- This ensures the transaction commits.
2020-07-29 10:15:37 -07:00
Aleksandr Melnikov
8d8472f52d Casting parameters to string. 2020-07-29 10:14:38 -07:00
Andrey Melnikov
12d3e84943 chore: documentation to meet codacy requirements 2020-07-28 22:54:02 -07:00
Andrey Melnikov
6f65f291d5 update: added migration for workflow template labels 2020-07-28 20:52:16 -07:00
Andrey Melnikov
ac5a394366 update: added utility to go migrations to find out if it has been run before as a sql migration 2020-07-28 20:52:02 -07:00
Andrey Melnikov
5b0fc82acf update: added new method to workflow templates to list all of them, which we need for certain migrations. 2020-07-28 20:50:58 -07:00
Andrey Melnikov
39c9511578 update: pagination with new methods to aid in starting a pagination and advancing it. 2020-07-28 20:50:17 -07:00
Andrey Melnikov
5d221f6140 update: added migration to update workflow template labels 2020-07-28 20:07:36 -07:00
Andrey Melnikov
da8cb2859a feat: added support for filtering workflow templates by a single label.
When a workflow template is created, or a new version is created, we now stores the labels for it as the latest labels. This makes it easier to filter based on labels.
2020-07-28 16:57:43 -07:00
Andrey Melnikov
5009a2643f fix: issue with label parsing where empty string did not return nil 2020-07-28 16:55:08 -07:00
Aleksandr Melnikov
e0ec2e5783 Fixing the version used.
- Otherwise, templates are not found consistently.
2020-07-28 16:17:31 -07:00
Andrey Melnikov
11d198a2db feat: Added API support for filtering workflow templates by labels. Logic not yet implemented. 2020-07-28 16:14:35 -07:00
Aleksandr Melnikov
9ab76e78fb Removing previous ParseParametersFromMAnifest.
- Instead, retrieving the WorkflowTemplateVersion from the database,
and using it's params for the WorkflowTemplate's
2020-07-28 15:07:52 -07:00
Aleksandr Melnikov
859a3d21c9 Adding code to Unmarshal the Parameters after DB query. 2020-07-28 15:07:17 -07:00
Aleksandr Melnikov
512bb04be5 Adding []byte field to struct.
- So we can load the JSONB data from the database.
2020-07-28 15:06:53 -07:00
Aleksandr Melnikov
00c22974a9 Updating WorkflowTemplateVersionColumns to also return "parameters"
column.
2020-07-28 15:06:31 -07:00
Aleksandr Melnikov
2bb66545e8 Fixing pagination.
- Results may be less than pageSize.
Changed to paginate only if there are over 0 results.
2020-07-28 11:56:20 -07:00
Andrey Melnikov
b0ec3194b6 fix: workflow execution uid = name now, we should not be returning the k8s uid. 2020-07-28 11:53:49 -07:00
Andrey Melnikov
81e3a7f299 fix: wrong namespace variable passed in 2020-07-28 11:53:27 -07:00
Aleksandr Melnikov
a913c69b71 Fixing the while loop condition.
Adding code to paginate through results.
2020-07-28 11:44:43 -07:00
Aleksandr Melnikov
16c04a9906 Adding code to load WorkflowTemplateVersionsDB. 2020-07-28 11:43:16 -07:00
Aleksandr Melnikov
013b41f102 Removing validateWorkflowTemplate because WorkflowTemplate is not
loaded from the database.
2020-07-28 11:42:57 -07:00
Aleksandr Melnikov
4d5f02c815 Converting parameters to JSON for database operations. 2020-07-28 11:42:16 -07:00
Aleksandr Melnikov
c1a22cd330 Adding migration to db.go 2020-07-28 11:41:29 -07:00
Andrey Melnikov
25049535e3 feat: Added generator for web routes. Added url for workflow executions. 2020-07-28 11:12:19 -07:00
Aleksandr Melnikov
2f8735c6d0 Added migration to go through current workflow_template_versions
and generate the "parameters" column values for each.
2020-07-27 17:41:41 -07:00
Aleksandr Melnikov
276f084fab Added SQL migration to add "parameters" column to workflow_template_versions
table.
2020-07-27 17:41:18 -07:00
Aleksandr Melnikov
8e9e51fc5e Added exposed function to update a WorkflowTemplateVersion in the database. 2020-07-27 17:41:00 -07:00
Aleksandr Melnikov
f9838a4614 Adding Parameters to WorkflowTemplateVersion struct. 2020-07-27 17:40:22 -07:00
Aleksandr Melnikov
36a5d26b4e Adding work-around functions for listWorkflowTemplateVersions and
ListWorkflowTemplateVersions.
2020-07-27 17:39:38 -07:00
Aleksandr Melnikov
e12cdafac2 Adding function to update a workflow_template_version row in the database. 2020-07-27 17:39:02 -07:00
Aleksandr Melnikov
e851a35b4e Fixing database connection string. 2020-07-27 12:07:34 -07:00
Aleksandr Melnikov
d0a83ffddd Adding the rest of the proto updated files. 2020-07-27 12:07:34 -07:00
Aleksandr Melnikov
29710519a1 Fixing the Parameter parsing from Manifest.
- Using specific function to achieve same functionality
Removing the for-loop because it caused duplicate values.
Wrong:
```json
  "parameters": [
    {
      "type": null,
      "required": null,
      "name": "source",
      "options": null,
      "hint": null,
      "value": "name: command\norder: 1\nvalue: python mnist/main.py --epochs=5\n",
      "display_name": null
    },
    {
      "type": null,
      "required": null,
      "name": "command",
      "options": null,
      "hint": null,
      "value": "name: command\norder: 1\nvalue: python mnist/main.py --epochs=5\n",
      "display_name": null
    }
```
Right:
```json
  "parameters": [
    {
      "options": [],
      "name": "source",
      "value": "https://github.com/onepanelio/tensorflow-examples.git",
      "type": "",
      "displayName": "",
      "hint": "",
      "required": false
    },
    {
      "options": [],
      "name": "command",
      "value": "python mnist/main.py --epochs=5",
      "type": "",
      "displayName": "",
      "hint": "",
      "required": false
    }
```
2020-07-27 12:07:33 -07:00
Aleksandr Melnikov
c05ac10c64 Adding Parameters to workflow template getWorkflowTemplate. 2020-07-27 12:07:33 -07:00
Aleksandr Melnikov
43a9c22d40 Adding Parameters to WorkflowTemplate to proto. 2020-07-27 12:07:32 -07:00
rushtehrani
2eec349af9 add Workspace volume params last 2020-07-26 22:53:37 -07:00
rushtehrani
f81cdc03f7 change hint and displayName for CVAT arg 2020-07-26 22:28:22 -07:00
rushtehrani
1276e82fb0 enable filesyncer support out of the box for CVAT 2020-07-26 21:56:13 -07:00
rushtehrani
8bfcb87e91 update CVAT workspace template to use new filesyncer 2020-07-24 22:29:49 -07:00
rushtehrani
30e25192c7 mount namespace config for system containers 2020-07-24 21:59:39 -07:00
Rush Tehrani
cb4a229984 Merge pull request #425 from onepanelio/fix/changing.secretAccountKey.key.to.be.consistent
fix: Use consistent naming convention for GCS artifactRepository secret key
2020-07-24 12:15:44 -07:00
Aleksandr Melnikov
c3f76f971c Removing comments. 2020-07-24 12:08:41 -07:00
Aleksandr Melnikov
dc27fd3319 Changing serviceAccountKey to be more consistent with other secret
keys.
2020-07-24 12:08:36 -07:00
rushtehrani
0a8744656c remove redeclared package 2020-07-24 11:51:49 -07:00
Rush Tehrani
1910a47a21 Merge pull request #423 from onepanelio/fix/putting.yaml.lib.back.for.nodepool.options
fix: Regression fix; We need the specific sigs.k8s.io/yaml library
2020-07-24 11:22:26 -07:00
Aleksandr Melnikov
e3fd781cd3 Merge branch 'dev' into fix/putting.yaml.lib.back.for.nodepool.options 2020-07-24 11:21:06 -07:00
Rush Tehrani
5eff42fb2c Merge pull request #422 from onepanelio/fix/adding.yaml.annotation.to.prevent.empty.keys
fix: Adding omitempty to prevent the keys from showing up in onepanel
2020-07-24 11:13:44 -07:00
Aleksandr Melnikov
3067c62a7f Regression fix; We need the specific sigs.k8s.io/yaml library
to properly unmarshal nodePoolOptions from params.yaml.
2020-07-23 21:09:37 -07:00
Aleksandr Melnikov
adb7f0b74a Adding omitempty to prevent the keys from showing up in onepanel
configmap, if they are not filled.
- Adding explicit yaml conversion for serviceAccountJSON, otherwise
"omitempty" shows in the configmap.
2020-07-23 20:45:37 -07:00
Andrey Melnikov
6753ead9f8 doc: component type 2020-07-23 20:10:35 -07:00
Andrey Melnikov
146411c370 feat: added components API 2020-07-23 19:57:18 -07:00
Rush Tehrani
bdc3d99fed Merge pull request #400 from onepanelio/feat/core.331-support.gcs.artifact.repository
feat: core.331 support.gcs.artifact.repository
2020-07-23 13:11:58 -07:00
Aleksandr Melnikov
aa6725fbc9 Another comment adjustment. 2020-07-22 17:00:14 -07:00
Aleksandr Melnikov
8da35695de Another comments adjustment. 2020-07-22 16:57:19 -07:00
Aleksandr Melnikov
fc7cdb5681 Another comments adjustment. 2020-07-22 16:46:14 -07:00
Aleksandr Melnikov
7bbeba544d Fixing comments per Codacy. 2020-07-22 16:37:55 -07:00
Aleksandr Melnikov
5b7f5c9724 Codacy feedback for comments. 2020-07-22 16:30:23 -07:00
Aleksandr Melnikov
1effb919d6 Per Codacy,
- Adding comments
- Refactoring variables names
- Fixing return variable order
2020-07-22 16:23:24 -07:00
Aleksandr Melnikov
7f6f58884a Per discussion, combining Config structs into Provider. 2020-07-22 16:01:33 -07:00
Aleksandr Melnikov
16274dd946 Moving some attributes form S3Config to S3Provider. 2020-07-22 15:32:38 -07:00
Aleksandr Melnikov
cebb412175 Removing extra yaml from import. 2020-07-22 15:31:58 -07:00
Aleksandr Melnikov
5dbb2104ce Merge branch 'dev' into feat/core.331-support.gcs.artifact.repository 2020-07-22 14:03:10 -07:00
Andrey Melnikov
2232d4e946 Merge pull request #417 from onepanelio/feat/onepanel.auth.header
feat: onepanel-auth-token header for authentication
2020-07-21 15:03:33 -07:00
Andrey Melnikov
e66c095500 update: added reserved workspace names 2020-07-21 14:37:51 -07:00
Andrey Melnikov
7af3c9dd7c feat: allowed onepanel-auth-token header to provide authentication token.
Updated server to make that key not require a grpc-gateway prefix.
2020-07-20 20:52:36 -07:00
Rush Tehrani
b01c0c41a8 Merge pull request #412 from onepanelio/fix/onepanelio.core.407-workspaces.missing.node.pools
fix: goose binary errors
2020-07-14 19:14:04 -07:00
Andrey Melnikov
59d0c95307 fix: extra run of goose up 2020-07-14 19:11:30 -07:00
Andrey Melnikov
d319d41929 fix: goose command since the package structure changed, we need to update it to reference the go migrations package. Further, we need to update the logic to run both migrations of sql and go. 2020-07-14 19:00:52 -07:00
Andrey Melnikov
9435404701 fix: filepath separator to include windows support. 2020-07-14 19:00:05 -07:00
Rush Tehrani
b6b8652829 Merge pull request #410 from onepanelio/fix/onepanelio.core.407-workspaces.missing.node.pools
fix: get workspaces now returns up-to-date node pool options
2020-07-14 18:39:22 -07:00
Andrey Melnikov
5073cbdff1 fix: issue where changing configmap crashed goose because migrations were re-added 2020-07-14 18:31:21 -07:00
Andrey Melnikov
0b77438d57 clean: drop nil initialization from var pointer as it is the default value. 2020-07-14 15:16:15 -07:00
Andrey Melnikov
59e7d58503 fix: get workspaces now returns up-to-date node pool options 2020-07-14 15:09:06 -07:00
Aleksandr Melnikov
fa96d6ef66 Merge branch 'dev' into feat/core.331-support.gcs.artifact.repository 2020-07-14 14:06:47 -07:00
Aleksandr Melnikov
6c0d3fe598 Refactored GCS client creation.
Added GetObject function to be consistent with S3 functionality.
Note
- pkg/client.go, line 88 passes in the JSON.
If ArtifactRepositoryGCSCondig was imported inside gcs.NewClient
code, an import cycle would be created.
2020-07-14 14:05:31 -07:00
Aleksandr Melnikov
b0361cdc6c Instead of passing the secret values into the configmap, pass
the secret reference and secret key.
2020-07-13 17:37:29 -07:00
Aleksandr Melnikov
e526505365 Fixing the Key to look for inside the secret. 2020-07-13 17:01:07 -07:00
Aleksandr Melnikov
993ce397aa Removing todo, verified Name is correct. 2020-07-13 16:02:14 -07:00
Aleksandr Melnikov
7a8df485ad Removing completed todos. 2020-07-10 17:53:33 -07:00
Aleksandr Melnikov
7936eac98d Adding a way to store the location of the secret and the secret key to use.
Adding another field to struct, which will store the ServiceAccountJSON.
- This will be generated by the API and used by the API for the GCS client.
2020-07-10 17:53:25 -07:00
Aleksandr Melnikov
94ae9071aa Adding exit condition to for true when iterating through bucket files. 2020-07-10 17:19:03 -07:00
Aleksandr Melnikov
8b6d10d112 Updating GCS MarshalToYaml
- Do not write the value of ServiceAccount to Config Map. This
exposes credentials.
- Properly write the reference the argo expects. The reference
points to the secret that contains the credentials.
2020-07-10 17:19:03 -07:00
Aleksandr Melnikov
a94ae526ca Merge pull request #393 from onepanelio/feat/provider-specific-config
feat: Add support for ResourceRequirements in node pools
2020-07-10 11:35:30 -07:00
Aleksandr Melnikov
8e2b1ab106 Merge branch 'dev' into feat/core.331-support.gcs.artifact.repository 2020-07-09 18:09:50 -07:00
Aleksandr Melnikov
e83e5d495e Injecting GCS configuration into ArtifactRepository. 2020-07-09 18:02:18 -07:00
Aleksandr Melnikov
0f5cf7be4d Fixing shadowed err. 2020-07-09 16:30:11 -07:00
Aleksandr Melnikov
7295ba36b3 Putting pack a required package. 2020-07-09 16:30:00 -07:00
rushtehrani
a8958b0136 move migration to correct folder 2020-07-09 15:35:06 -07:00
rushtehrani
69a6a72303 add missing methods after conflict resolution 2020-07-09 14:36:24 -07:00
Rush Tehrani
92f2be7cac Merge branch 'dev' into feat/provider-specific-config 2020-07-09 14:18:49 -07:00
Rush Tehrani
46f4465103 Merge pull request #374 from onepanelio/test/docker.database
feat: setup unit tests with database
2020-07-09 14:17:41 -07:00
rushtehrani
ca45e29dd5 remove unused file 2020-07-09 14:06:38 -07:00
rushtehrani
dfd892d6f1 update func names to match new convention 2020-07-09 13:50:42 -07:00
rushtehrani
c1d123ec2c use run-tests for all tests 2020-07-09 13:43:28 -07:00
rushtehrani
7c2001f5ac Merge branch 'test/docker.database' of https://github.com/onepanelio/core into test/docker.database 2020-07-09 12:45:23 -07:00
rushtehrani
aff166fb40 change test names to match new convention 2020-07-09 12:45:16 -07:00
Andrey Melnikov
40759738ae fix: took up the messages if a go migration was already ran as it was printed after the goose message, which was a bit confusing. 2020-07-09 12:27:44 -07:00
Andrey Melnikov
a0454cdfc3 fix: backwards compatibility for previous go migrations. Don't run them if they were ran earlier in the goose_db_version db table. 2020-07-09 12:23:38 -07:00
Rush Tehrani
41d3d7be34 Merge pull request #399 from onepanelio/fix/new-cvat-template
fix: Update CVAT template to Comment out filesyncer to avoid crashing
2020-07-09 11:46:31 -07:00
rushtehrani
4dc60c2113 update cvat template 2020-07-09 11:43:25 -07:00
Rush Tehrani
3cf11eaa58 Merge pull request #398 from onepanelio/revert-394-fix/cvat-template
Revert "fix: Comment out filesyncer to avoid CVAT template crashing"
2020-07-09 11:33:01 -07:00
Rush Tehrani
3b605545b1 Revert "fix: Comment out filesyncer to avoid CVAT template crashing" 2020-07-09 11:32:16 -07:00
Rush Tehrani
eef3309080 Merge pull request #394 from onepanelio/fix/cvat-template
fix: Comment out filesyncer to avoid CVAT template crashing
2020-07-09 11:27:11 -07:00
Aleksandr Melnikov
4e3eaae1f6 Updating ListFiles to support GCS. 2020-07-09 10:55:37 -07:00
rushtehrani
2ddab18a59 rename function 2020-07-08 17:50:16 -07:00
Aleksandr Melnikov
6727b00b05 Updating GetArtifact to support GCS. 2020-07-08 14:00:51 -07:00
Aleksandr Melnikov
81c05f9954 Adding error check. 2020-07-08 14:00:20 -07:00
Aleksandr Melnikov
ac5bf65ae9 Added GCS support for Metrics retrieval. 2020-07-08 13:36:59 -07:00
Aleksandr Melnikov
66431a21eb Added code to get the log object from GCS.
Added switch statement for GCS versus S3.
2020-07-08 13:17:07 -07:00
Aleksandr Melnikov
8d662d6ce0 Adding FormatKey function for GCS Config. 2020-07-08 13:16:42 -07:00
Aleksandr Melnikov
ad16285fd4 Fixing typo.
Adding explicit error checking for opts.SetRange.
2020-07-08 12:53:12 -07:00
Aleksandr Melnikov
f024889ca8 Implementing switch statement since we have s3 and gcs storage now.
- GCS has necessary credentials in serviceAccount as json
2020-07-08 12:52:55 -07:00
Aleksandr Melnikov
d7df089d31 When grabbing artifactRepository from config, check if
S3 or GCS are set.
- If not, throw an error.
2020-07-08 12:52:11 -07:00
Aleksandr Melnikov
2cd3f76299 Adding GetGCSClient function.
- Returns client that can interact with google cloud storage.
2020-07-08 12:51:45 -07:00
Aleksandr Melnikov
965e8dda92 Adding Google library for Google Cloud Storage. 2020-07-08 11:33:47 -07:00
Aleksandr Melnikov
c13c868143 Adding GCS structs for Artifact Repository configuration.
- These will be unmarshalled into via CLI from params.yaml.
- Added helper function, MarshalToYaml.
2020-07-06 21:56:39 -07:00
Aleksandr Melnikov
e2f94e937c Adding function to output the CLI required YAML for manifests.
- Adding helper structs and tags
2020-07-06 17:07:14 -07:00
Aleksandr Melnikov
df74766a66 Adding yaml tags for unmarshalling into the struct. 2020-07-06 17:06:40 -07:00
Aleksandr Melnikov
30305f42e1 Adding Yaml V3. 2020-07-06 17:04:12 -07:00
rushtehrani
41b2f322da update cvat version 2020-07-04 23:13:39 -07:00
rushtehrani
946ab11dab fix: comment out filesyncer and reference docs 2020-07-04 15:28:33 -07:00
rushtehrani
886e39244e add comments to exported structs and methods 2020-07-03 11:43:52 -07:00
rushtehrani
7ce8d9cdfa support workflow params for resource injection 2020-07-03 11:38:04 -07:00
rushtehrani
2868ab69c9 add resources requests and limits to nodePoolOptions 2020-07-02 22:29:05 -07:00
rushtehrani
18428c4e82 add nvidia-smi in case of aks 2020-07-02 19:19:27 -07:00
Andrey Melnikov
df3dba4e2e test: Added basic test for CreateWorkspace (capital) 2020-07-02 16:45:52 -07:00
Andrey Melnikov
d097cdfefe clean: removed UpdateWorkflowTemplateVersion as it did nothing and should not be used.
#breaking-change
2020-07-02 16:45:34 -07:00
rushtehrani
cee49e67f4 add ONEPANEL_PROVIDER env var 2020-07-02 16:44:22 -07:00
Andrey Melnikov
640c7b54f5 test: fixed issue where Updating the workspace status did not correctly detect a not-found condition and added tests for it. 2020-07-02 16:22:23 -07:00
Andrey Melnikov
655020b54b clean: removed unnecessary generation of uid in "injectWorkspaceSystemParameters" function.
Updated time tests to compare against time.Time{} because nanosecond difference comparison doesn't always work.
2020-07-02 15:46:46 -07:00
Andrey Melnikov
5117c8b34e tests: separated out logic to convert workspace status to a field map and added tests for it 2020-07-02 15:41:54 -07:00
Andrey Melnikov
045912fe5c tests: added more tests surround workspace templates and workspaces 2020-07-02 13:21:11 -07:00
Andrey Melnikov
3673b3da59 tests: added more tests for workspace templates 2020-07-02 12:19:39 -07:00
Andrey Melnikov
d7db598cc6 clean: removed unused methods 2020-07-02 12:19:15 -07:00
Andrey Melnikov
f3a2856d65 fix: codacy issues 2020-07-02 11:20:18 -07:00
Andrey Melnikov
f1045710a0 update: refactored creating a workflow execution 2020-07-02 11:17:31 -07:00
Andrey Melnikov
ed621633df update: updated tests to have method calls for particular cases. Added more tests. 2020-07-01 16:07:20 -07:00
Andrey Melnikov
c5d1ec9b1f fix: go migrations since they would still occur in the order of creation timestamp. Manually initializing them fixes this issue. 2020-07-01 16:06:18 -07:00
Andrey Melnikov
5c225b405d clean: reworked creating a workflow template and version to consolidate logic 2020-06-30 13:05:28 -07:00
Andrey Melnikov
bd5ec0e7c2 fix: updated versions to use a bigint to store nanosecond precision.
updated code to reflect this change and migrated it over.
2020-06-30 11:42:07 -07:00
Andrey Melnikov
176fcc3008 update: recreate issue with workflow template versions being created one after another 2020-06-30 10:59:32 -07:00
Andrey Melnikov
945b3bc2e5 fix: moved migration into appropriate folder 2020-06-30 10:50:35 -07:00
Andrey Melnikov
1bdd6a7eda Merge branch 'test/docker.database' of github.com:onepanelio/core into test/docker.database 2020-06-30 10:50:05 -07:00
Andrey Melnikov
f78ae63afa clean: added method to SysConfig to return database connection information 2020-06-30 10:49:22 -07:00
Andrey Melnikov
114f290cde docs: documented some workflow execution methods 2020-06-30 10:49:22 -07:00
Andrey Melnikov
1a15df4999 fix: testing commit for db connection 2020-06-30 10:49:22 -07:00
Andrey Melnikov
f9f6d75be8 fix: remove extraneous character 2020-06-30 10:49:22 -07:00
Andrey Melnikov
782617a3e9 clean: clean up code for cron workflows 2020-06-30 10:49:22 -07:00
Andrey Melnikov
0ec109da2b fix: how we get argo mock. 2020-06-30 10:49:22 -07:00
Andrey Melnikov
b8b9ff2543 clean: capitalization of names and added WorkflowTemplate uid generator method to encapsulate the behavior 2020-06-30 10:49:22 -07:00
Andrey Melnikov
0b54bd1c43 test: added tests for workflow executions and creating workflow templates 2020-06-30 10:49:22 -07:00
Andrey Melnikov
cb27809665 fix: dynamic database service name in testing 2020-06-30 10:49:22 -07:00
Andrey Melnikov
252e53a793 feat: added flag to database service for testing 2020-06-30 10:49:22 -07:00
Andrey Melnikov
05fc2b1422 fix: inconsistent testing variables and github action variables 2020-06-30 10:49:22 -07:00
Andrey Melnikov
839b9ac2e3 clean: removed custom configmap/secret setting as providing the objects to k8s mock will have them be automatically loaded. 2020-06-30 10:49:22 -07:00
Andrey Melnikov
2091485345 feat: added basic unit testing. Also separated migrations to separate sql and go migrations. This makes it easier to unit test where we just need sql migrations. 2020-06-30 10:49:22 -07:00
Andrey Melnikov
a5cc3cf38a Merge pull request #382 from onepanelio/fix/migration
fix: migration issue where workflow name clashed because of unix time…
2020-06-29 22:20:37 -07:00
Andrey Melnikov
4bad6b8858 fix: migration issue where workflow name clashed because of unix timestamp 2020-06-29 22:17:36 -07:00
Andrey Melnikov
f1b31c7d3d Merge pull request #380 from onepanelio/feat/onepanelio.core-376.update.cvat.template
feat: cvat template
2020-06-29 10:56:59 -07:00
Andrey Melnikov
ec2f9b3ecd clean: added method to SysConfig to return database connection information 2020-06-26 17:35:24 -07:00
Andrey Melnikov
a2c11050fc docs: documented some workflow execution methods 2020-06-26 17:26:11 -07:00
Andrey Melnikov
b3f9c44482 fix: testing commit for db connection 2020-06-26 17:25:45 -07:00
Andrey Melnikov
8aa10c9630 fix: remove extraneous character 2020-06-26 17:17:33 -07:00
Andrey Melnikov
6c8f6cee5b clean: clean up code for cron workflows 2020-06-26 17:15:01 -07:00
Andrey Melnikov
60bfe4e02a fix: how we get argo mock. 2020-06-26 17:14:31 -07:00
Andrey Melnikov
9e022b24f7 clean: capitalization of names and added WorkflowTemplate uid generator method to encapsulate the behavior 2020-06-26 16:14:07 -07:00
Andrey Melnikov
be63c412be test: added tests for workflow executions and creating workflow templates 2020-06-26 16:11:57 -07:00
Andrey Melnikov
df582292b7 fix: document the up and down migration for codacy. 2020-06-26 12:18:25 -07:00
Andrey Melnikov
636f7cc72f update: migration to update cvat 2020-06-26 12:09:09 -07:00
Andrey Melnikov
b8912d4f4a update: return error if there is one. 2020-06-26 12:08:58 -07:00
Andrey Melnikov
2b8c2b4589 fix: more descriptive error when yaml conversion fails 2020-06-26 12:08:46 -07:00
Rush Tehrani
c98d1d5614 Merge pull request #379 from onepanelio/fix/onepanelio.core-378.workspace.name.formatting
fix: updated workspace name regex to allow spaces and uppercase letters
2020-06-26 10:31:11 -07:00
Andrey Melnikov
88f6ba2fb8 clean: cleaned up workspace name tests to be easier and clearer 2020-06-26 10:28:02 -07:00
Andrey Melnikov
71ce7289fd fix: updated workspace name regex to allow spaces and uppercase letters 2020-06-26 09:27:39 -07:00
Andrey Melnikov
62f53ee605 fix: dynamic database service name in testing 2020-06-25 16:51:18 -07:00
Andrey Melnikov
81241b0cc9 feat: added flag to database service for testing 2020-06-25 16:48:22 -07:00
Andrey Melnikov
90602b8f87 fix: inconsistent testing variables and github action variables 2020-06-25 16:34:42 -07:00
Andrey Melnikov
ff2e948623 clean: removed custom configmap/secret setting as providing the objects to k8s mock will have them be automatically loaded. 2020-06-25 16:30:10 -07:00
Andrey Melnikov
a831ed164d feat: added basic unit testing. Also separated migrations to separate sql and go migrations. This makes it easier to unit test where we just need sql migrations. 2020-06-25 16:27:33 -07:00
Andrey Melnikov
22bcd5f838 Merge pull request #372 from onepanelio/fix/grpc-status
fix: return correct gRPC code
2020-06-24 12:26:02 -07:00
Andrey Melnikov
21ab9cab01 fix: workspace name regex
600s was valid, but it shouldn't be due to other constraints. The s matches.
2020-06-24 12:21:56 -07:00
rushtehrani
2daf7f8c72 add comments to GRPCStatus method 2020-06-24 11:25:03 -07:00
rushtehrani
3d1382ba17 fix: return correct gRPC code 2020-06-24 11:20:27 -07:00
Rush Tehrani
51a76523d3 Merge pull request #369 from onepanelio/feat/onepanelio.core-362.api.return.node.pools
feat: added endpoint to list node pools
2020-06-23 19:25:08 -07:00
rushtehrani
6b08cd3233 allow access to basic config settings to all logged in user 2020-06-23 19:20:57 -07:00
Andrey Melnikov
2a499f228a update: removed GetValueOrEmpty method since map access does the exact same thing.
Removed more sensitive data from config response
2020-06-23 19:11:12 -07:00
Andrey Melnikov
2c0279eba1 Merge pull request #371 from onepanelio/fix/workspace-template-message
fix:  workspace template message
2020-06-23 18:05:44 -07:00
Andrey Melnikov
cc7ec322b3 docs: ConfigServer 2020-06-23 17:56:46 -07:00
rushtehrani
882901facb se => e 2020-06-23 17:55:48 -07:00
rushtehrani
c59c3f2492 StatusError => UserError and added Go doc comments 2020-06-23 17:52:55 -07:00
Andrey Melnikov
3384564c42 update: Separate config server 2020-06-23 17:52:39 -07:00
rushtehrani
e22056876e add new error type and override workspace template validation messages 2020-06-23 17:42:51 -07:00
rushtehrani
b7bd16610c fix: show correct parameter error for workspace templates 2020-06-23 17:00:14 -07:00
Rush Tehrani
fe5a071b61 Merge pull request #370 from onepanelio/fix/onepanelio.core.361-workspace.names.validation
fix: validate workspace names
2020-06-23 16:33:32 -07:00
Andrey Melnikov
50e6e83a16 update: updated the way we validate workspace name 2020-06-23 15:27:29 -07:00
Andrey Melnikov
bd49e64b78 update: workspace names are now validated to ensure they are okay as subdomains 2020-06-23 12:14:16 -07:00
Andrey Melnikov
90003fa2d9 doc: added missing doc for ListNodePools server method 2020-06-23 11:04:38 -07:00
Andrey Melnikov
1440a660ef feat: added endpoint to list node pools 2020-06-23 11:01:15 -07:00
Rush Tehrani
925d278163 Merge pull request #364 from onepanelio/feat/runtime-params
feat: runtime params
2020-06-22 14:35:36 -07:00
Andrey Melnikov
5a13be299f fix: code cleanup 2020-06-22 13:51:34 -07:00
Andrey Melnikov
3d5dcb632a docs: for various types and some variable name updates per go conventions 2020-06-22 13:43:17 -07:00
Andrey Melnikov
5620bfb3fb docs: workflow_template_types 2020-06-22 12:45:13 -07:00
Andrey Melnikov
dea5eeda3b clean: WorkflowTemplateVersionId -> WorkflowTemplateVersionID 2020-06-22 12:29:26 -07:00
Andrey Melnikov
1cf4dd6658 docs: label_types 2020-06-22 12:25:54 -07:00
Andrey Melnikov
d079d5bad8 docs: file_types 2020-06-22 12:24:27 -07:00
Andrey Melnikov
0d738fe2ad doc: documentation updates 2020-06-22 12:21:30 -07:00
Andrey Melnikov
8cf8436afc fix: issue where archiving workspace template was breaking because it attempted to do so for every version, but there was no logical difference since it used the template 2020-06-22 12:11:55 -07:00
Andrey Melnikov
ab9627f249 docs: added more docs 2020-06-22 11:32:33 -07:00
Andrey Melnikov
a0197e0883 fix: issue where workspace template versions did not correctly mark latest as latest 2020-06-22 11:32:18 -07:00
Andrey Melnikov
97c5e2da6f fix: issue where listing cron workflows failed 2020-06-22 11:11:53 -07:00
rushtehrani
817ec61bdf fix workspace termination 2020-06-21 13:27:12 -07:00
rushtehrani
c56a1c0e96 inject runtime params into Argo workflow as well 2020-06-21 11:08:45 -07:00
rushtehrani
441722a8ba runtime params with only arguments.parameters changes 2020-06-21 01:03:41 -07:00
rushtehrani
ec32dc825c fix nodepool issue 2020-06-20 13:18:52 -07:00
Andrey Melnikov
9f5b12da69 update: moved sqlutil to util/sql 2020-06-20 13:18:52 -07:00
Andrey Melnikov
1526194e71 clean: CronWorkflow logic since label options are now a map and not a pointer to a map. 2020-06-20 13:18:52 -07:00
Andrey Melnikov
017c3ca899 update: CreateWorkflowExecution now takes in a WorkflowTemplate so it can be more easily configured. Workspaces do this by injecting runtime variables. 2020-06-20 13:18:52 -07:00
Andrey Melnikov
7887f3a4ef feat: added Getx method to db wrapper to more easily interact with squirrel. 2020-06-20 13:18:52 -07:00
Andrey Melnikov
d209423100 clean:
* updated method names to fit go conventions of uppercase. Db -> DB
* updated some method calls to use updated column select functions to remove extraneous empty string
* updated methods to use new label function that does nothing if no labels are passed in, this simplifies the code.
* updated some methods to use new Selectx function, reducing code in caller.
2020-06-20 13:18:52 -07:00
Andrey Melnikov
1e3a5d4faf clean: Updated DB to be a struct with convenience functions for getting data. 2020-06-20 13:18:52 -07:00
Andrey Melnikov
f6a7d3ec58 clean: created separate package for sql utils, and put in an updated FormatColumnSelect in there. Also added tests.
This update makes alias optional, so you don't need to provide an empty string as an argument. It also removes extraColumns as an argument as that is easily managed by squirrel.
2020-06-20 13:18:52 -07:00
Andrey Melnikov
ef9c185977 Merge pull request #359 from onepanelio/feat/workspace-crd
feat: Authorize against Workspace CRD
2020-06-19 10:29:28 -07:00
rushtehrani
c7184d133e check auth by uid in workspace get request 2020-06-18 19:35:35 -07:00
rushtehrani
ec2ad1a9be fix param 2020-06-18 19:35:35 -07:00
rushtehrani
640d4f6e9f add Workspace CRD auth check and creation 2020-06-18 19:35:35 -07:00
Rush Tehrani
027a93f044 Merge pull request #357 from onepanelio/fix/params
fix: reference to parameters can now be defined as `workspace.parameters`
2020-06-18 19:34:47 -07:00
Rush Tehrani
5fe3ef9213 Merge pull request #352 from onepanelio/feat/onepanelio.core-348.system.updates
feat: runtime variables and system config change reload
2020-06-18 19:31:41 -07:00
Andrey Melnikov
49c1c6a0cd fix: issue where getting workspace did not have the runtime parameters 2020-06-18 15:23:25 -07:00
Andrey Melnikov
ce9fd4bf52 update: config updates and related usage updates. 2020-06-18 15:22:27 -07:00
Andrey Melnikov
e1ade14d6c Merge branch 'feat/onepanelio.core-348.system.updates' of github.com:onepanelio/core into feat/onepanelio.core-348.system.updates 2020-06-18 12:41:01 -07:00
Andrey Melnikov
d823a951fb fix: fixed issue where channels were not working for restarting server. 2020-06-18 12:40:36 -07:00
Andrey Melnikov
9e236aafb2 test: locks instead of channels 2020-06-18 12:40:36 -07:00
Andrey Melnikov
aaf6d31847 fix: issue where watch was started multiple times. 2020-06-18 12:40:36 -07:00
Andrey Melnikov
efffe1f070 fix: added missing migration 2020-06-18 12:40:36 -07:00
Andrey Melnikov
6fe23c7ed8 clean: code cleanup and minor documentation 2020-06-18 12:40:09 -07:00
Andrey Melnikov
8684e44632 update: added logic to inject runtime variables in Workspace templates 2020-06-18 12:40:08 -07:00
Andrey Melnikov
8c8d4e237a fix: removed db reference to workspace url 2020-06-18 12:36:20 -07:00
Andrey Melnikov
0e2eb1580e fix: removed reference to workspace.url 2020-06-18 12:36:20 -07:00
Andrey Melnikov
72d6892276 update: workspace url is no longer stored in db but is auto generated as it depends on config. 2020-06-18 12:36:20 -07:00
Andrey Melnikov
24348647a8 poc: proof of concept for a server that detects configmap changes and updates the server accordingly. 2020-06-18 12:36:20 -07:00
Andrey Melnikov
d736e773ca Merge pull request #356 from onepanelio/fix/onepanelio.core.355-migrations.crash
fix: migrations crash
2020-06-18 12:32:28 -07:00
Andrey Melnikov
fddf2d6a81 fix: fixed issue where channels were not working for restarting server. 2020-06-18 11:55:01 -07:00
Andrey Melnikov
7df9ac6240 test: locks instead of channels 2020-06-17 19:56:37 -07:00
Rush Tehrani
7ddd6873ea Merge branch 'feat/onepanelio.core-348.system.updates' into fix/params 2020-06-17 17:27:47 -07:00
Andrey Melnikov
63011e1ab4 fix: issue where watch was started multiple times. 2020-06-17 15:01:44 -07:00
Andrey Melnikov
b6c67dd774 fix: added missing volume 2020-06-17 12:58:59 -07:00
Andrey Melnikov
c91efc7a60 fix: added missing migration 2020-06-17 12:27:07 -07:00
Andrey Melnikov
b6b8d624d1 fix: removed constraint on workflow template migration for uid.
This fixes an issue where the go migrations to add templates crashed because the current code assumes uid no longer exists for workflow template versions, but at that point in time, it still does.
2020-06-17 11:41:22 -07:00
rushtehrani
504c4bf597 workspaceSpec => spec 2020-06-16 21:32:56 -07:00
rushtehrani
f19d3b4e53 allow user to use {{workspace.parameters}} in workspace template 2020-06-16 21:26:14 -07:00
Andrey Melnikov
c657a004f0 fix: removed references to workflow template version uid as it is not needed and currently causing a crash with migrations as it is set to the timestamp, which is limited to second precision 2020-06-16 20:06:24 -07:00
Andrey Melnikov
3253aac814 fix: issue where the wrong workflow template was being logged 2020-06-16 19:47:44 -07:00
Andrey Melnikov
57502417ad fix: migrations return the error instead of crashing. This allows goose to perform any logic it needs to respond. 2020-06-16 19:47:29 -07:00
Andrey Melnikov
56777b48c3 fix: parameter name 2020-06-16 10:47:48 -07:00
Andrey Melnikov
3074622046 Merge branch 'dev' into feat/onepanelio.core-348.system.updates 2020-06-16 10:46:27 -07:00
Andrey Melnikov
ba72b1435f clean: code cleanup and minor documentation 2020-06-16 10:30:37 -07:00
Andrey Melnikov
d56b728995 update: added logic to inject runtime variables in Workspace templates 2020-06-15 18:42:47 -07:00
Aleksandr Melnikov
d213fda778 Merge pull request #351 from onepanelio/fix/shared-memory
fix: Shared memory in Workspaces
2020-06-15 17:12:38 -07:00
Andrey Melnikov
a983e26b92 fix: removed db reference to workspace url 2020-06-15 14:06:51 -07:00
Andrey Melnikov
9f6a1be08e fix: removed reference to workspace.url 2020-06-15 14:06:06 -07:00
Andrey Melnikov
9c356dfd8b update: workspace url is no longer stored in db but is auto generated as it depends on config. 2020-06-15 13:56:22 -07:00
rushtehrani
814b289024 fix shared memory issues in Workspaces 2020-06-12 18:55:21 -07:00
Andrey Melnikov
ee9cf10667 Merge pull request #350 from onepanelio/feat/volume-claims
feat: Allow users to define their own VolumeClaimTemplates
2020-06-12 10:44:36 -07:00
rushtehrani
5b69516867 skip parameters for volumes that have storage set 2020-06-11 22:23:39 -07:00
rushtehrani
0c28cc1576 rename field 2020-06-11 21:06:10 -07:00
rushtehrani
7cddeb9311 feat: Custom volume claim templates 2020-06-11 20:59:29 -07:00
Andrey Melnikov
64a078f4d6 poc: proof of concept for a server that detects configmap changes and updates the server accordingly. 2020-06-11 20:19:48 -07:00
rushtehrani
3f4d84398b += 1 => ++ 2020-06-11 12:23:06 -07:00
rushtehrani
5ecd8ca185 order contributors by number of contributions 2020-06-11 12:08:30 -07:00
rushtehrani
73e7cda6f1 fix contributor sorting 2020-06-11 11:16:17 -07:00
Rush Tehrani
9af50d36b3 Merge pull request #346 from onepanelio/feat/authorization.updates
feat: Centralize authorization to one endpoint
2020-06-10 23:02:03 -07:00
Andrey Melnikov
0e9ec72527 update: error variable names to just err for simplicity 2020-06-10 22:56:24 -07:00
Andrey Melnikov
b8191f6b1f Merge remote-tracking branch 'origin/feat/onepanelio.core.266-is.authorized.changes' into feat/authorization.updates 2020-06-10 22:44:51 -07:00
Andrey Melnikov
5f6b995564 chore: added comments to some modified methods 2020-06-10 22:38:32 -07:00
Andrey Melnikov
beb867eb22 Merge remote-tracking branch 'origin/feat/onepanelio.core.266-is.authorized.changes' into feat/onepanelio.core.266-is.authorized.changes 2020-06-10 15:25:48 -07:00
Andrey Melnikov
cd8298b654 fix: config missing for goose 2020-06-10 15:25:34 -07:00
rushtehrani
c4d9c8b9a8 check != nil first 2020-06-10 14:34:50 -07:00
Andrey Melnikov
6e1a3729f2 fix: wrong config 2020-06-10 14:26:26 -07:00
Andrey Melnikov
483c79abb3 update: cache system config for entire application and not just per request 2020-06-10 14:19:33 -07:00
Andrey Melnikov
79d5babfcb update: IsAuthorized request to only be POST since the additional HEAD binding didn't work. Also updated the request to get data from headers if nothing is in body. 2020-06-10 10:44:33 -07:00
Aleksandr Melnikov
322265dce2 Merge pull request #339 from onepanelio/chore/release-cmd
chore: update release command
2020-06-09 11:53:49 -07:00
Aleksandr Melnikov
3079bbf0be Adding code to print the error. 2020-06-09 11:22:14 -07:00
Andrey Melnikov
78a9b845a8 Merge pull request #343 from onepanelio/refactor/correct-context-name
refactor: clean up client code
2020-06-09 10:31:34 -07:00
rushtehrani
40eb461541 update Windows installation info 2020-06-08 23:37:23 -07:00
rushtehrani
3c03bd5d6c list changelog items in asc order 2020-06-08 16:15:01 -07:00
rushtehrani
ddd529f9bf allow for all conventional commit prefixes 2020-06-08 16:05:55 -07:00
rushtehrani
4c4d01ed09 use non-string context key 2020-06-08 15:43:31 -07:00
rushtehrani
601541ebbf always use ClientContextKey 2020-06-08 15:32:21 -07:00
rushtehrani
5f6bda8838 refactor: clean up client code 2020-06-08 15:25:02 -07:00
Andrey Melnikov
c226ff8419 update: removed code specific to x-original-auth based on changes upcoming to structure.
* Auth token will always be present unless you are validating an auth token.
2020-06-08 14:44:28 -07:00
Andrey Melnikov
8cd3cc5836 update: cache system config 2020-06-08 14:03:59 -07:00
Andrey Melnikov
27203d4d7f docs: for AuthServer 2020-06-08 11:59:00 -07:00
rushtehrani
be4ce07b7c gen-release-md structs should not be exported 2020-06-06 19:15:27 -07:00
rushtehrani
a30b46dff9 print contributor names in alphabetical order 2020-06-06 14:44:19 -07:00
rushtehrani
295a3b9484 update instructions 2020-06-06 14:33:57 -07:00
rushtehrani
c9ee8f301e handle 403 status code 2020-06-06 14:11:14 -07:00
rushtehrani
a8a97d608e update release command 2020-06-06 14:03:29 -07:00
Andrey Melnikov
77a457ae01 fix: wrong group permissions 2020-06-05 16:03:14 -07:00
Andrey Melnikov
88955d4e15 fix: issue where request data did not come through to api 2020-06-05 16:03:05 -07:00
Rush Tehrani
facbed59bc Merge pull request #335 from onepanelio/feat/core.288-add.pytorch.tensorflow.workspace.template.migrations
feat: Adding Pytorch and Tensorflow to workflow templates, as runnable workflow executions.
2020-06-05 12:56:08 -07:00
rushtehrani
71781426e0 template name changes + comments on metrics 2020-06-05 12:55:36 -07:00
Aleksandr Melnikov
f48e749721 Adding comments. 2020-06-05 12:34:04 -07:00
Aleksandr Melnikov
56f87f39d6 Using the right archive function for workflow templates. 2020-06-05 12:07:42 -07:00
Aleksandr Melnikov
334642c091 Commenting out more slack related code. 2020-06-05 12:07:42 -07:00
Aleksandr Melnikov
4cd5e619a5 Initial code of adding templates, up and down code. 2020-06-05 12:07:42 -07:00
Aleksandr Melnikov
b3a0365447 Adding placeholder migration files. 2020-06-05 12:07:42 -07:00
rushtehrani
07d6c1cc4b update gen-release-md command 2020-06-04 19:17:30 -07:00
Rush Tehrani
38becdd251 Merge pull request #330 from onepanelio/fix/docker.build.breaking
fix: fix docker build
2020-06-04 18:33:05 -07:00
Aleksandr Melnikov
3c2786ed6d Updating paths in README under cmd dir. 2020-06-04 18:05:31 -07:00
Aleksandr Melnikov
3378899c5c Adding explanation to contributing. 2020-06-04 18:05:13 -07:00
Aleksandr Melnikov
1efd66d010 Updating path in Dockerfile. 2020-06-04 18:04:31 -07:00
Aleksandr Melnikov
4895d48e11 Moving commands into their own folders. 2020-06-04 18:04:14 -07:00
Rush Tehrani
df7ce2f752 Merge pull request #328 from onepanelio/chore/update-commands
chore: update gen-release-md command and README
2020-06-04 16:36:52 -07:00
rushtehrani
f20a7a2b14 fix README headings 2020-06-04 15:52:39 -07:00
rushtehrani
327c73f22a chore: update gen-release-md command and README 2020-06-04 15:47:00 -07:00
Rush Tehrani
b3e7ed5941 Merge pull request #326 from onepanelio/fix/slack-yaml
fix: Slack notify YAML indentation
2020-06-04 15:24:42 -07:00
Andrey Melnikov
e2f027dd61 update: centralized authorization logic for workspace actions into one IsAuthorized endpoint 2020-06-04 14:01:07 -07:00
rushtehrani
9996bfbbc3 fix: Slack notify YAML indentation 2020-06-04 11:41:46 -07:00
Aleksandr Melnikov
574301df07 Merge pull request #323 from onepanelio/fix/code.refactor
fix: Fixing function name.
2020-06-04 10:22:28 -07:00
rushtehrani
6834f660d7 fix: use correct method name 2020-06-04 10:00:56 -07:00
Aleksandr Melnikov
e8e37cd8ea Fixing function name. 2020-06-04 09:59:28 -07:00
Rush Tehrani
a47bbe949b Merge pull request #286 from onepanelio/feat/add.cvat.migration.template
feat: add cvat migration template
2020-06-04 09:51:02 -07:00
Aleksandr Melnikov
7c72a36e8b Fixing parameter to fix convention. 2020-06-04 09:12:16 -07:00
Aleksandr Melnikov
8d4989d2db Commenting more functions per codacy. 2020-06-04 09:08:37 -07:00
Aleksandr Melnikov
2de59c22cf Fixing "Id" in function name. 2020-06-04 09:05:13 -07:00
Aleksandr Melnikov
d23ce9b6a9 Documenting package migration. 2020-06-04 09:04:42 -07:00
Aleksandr Melnikov
02f3904d6a Documenting cvat migrations. 2020-06-04 08:52:21 -07:00
rushtehrani
883b7bee30 clean up migrations 2020-06-03 18:27:17 -07:00
Aleksandr Melnikov
ff7aa917f7 Removing column that does not exist. 2020-06-03 16:57:22 -07:00
Aleksandr Melnikov
183296ff63 Merge pull request #312 from onepanelio/chore/gen-release-md-script
chore: generate release MD script
2020-06-03 13:31:58 -07:00
Aleksandr Melnikov
9d23b111b6 Marking goose up/down errors as fatal.
- Migrations should not go on if there is an error
2020-06-03 12:47:34 -07:00
Aleksandr Melnikov
8b26a84162 Updated ArchiveWorkspaceTemplate.
- Fixed various error message responses
- Added code to grab the WorkspaceTemplate versions
Then, code will run through these versions and grab workspaces that use
that version.
Then, code will try to Archive those workspaces (delete k8s resources,
archive database entries).
Finally, code cleans up the related WorkflowTemplate.
- Updated method docs
2020-06-03 12:46:33 -07:00
Andrey Melnikov
9d3150ccd3 Merge pull request #309 from onepanelio/fix/sys-param-priority
fix: sys param priority
2020-06-03 10:56:43 -07:00
rushtehrani
6460fefbd8 append user defined parameters after sys params 2020-06-02 22:31:52 -07:00
Rush Tehrani
7a9aa28210 Merge pull request #310 from onepanelio/feat/onepanelio.core.147-workflow.executions.template.version
feat: workflow template created at is selected when listing workflow executions
2020-06-02 19:10:36 -07:00
rushtehrani
1c085d8794 chore: Generate release MD script 2020-06-02 19:01:51 -07:00
Aleksandr Melnikov
1055b228a1 Re-arranged the code that archives the workspace template.
- This code was re-arranged to focus on archiving the k8s components
first, then the database.
- Also, workspace components are archived first,
because they rely on the workflow templates being present.
If workflow template is archived first, then the clean-up
can't resume to run again if some error is thrown.
This arrangement will ensure that if an error occurs during clean-up,
it can be re-run without throwing an error of missing prerequisite data.
- Removed an early return statement, which prevented the rest
of the clean-up
- Added extra code to not return an error if no workflow templates
are found in the database. This is to ensure k8s cleanup can continue.
2020-06-02 17:09:54 -07:00
Aleksandr Melnikov
05ad9ca2cc Added code to handle a case where there are no workspaces returned.
- This is if there are no workspaces in the database.
2020-06-02 17:06:15 -07:00
Aleksandr Melnikov
0f5d27a60d Fixing an issue with Down migrations.
- The passed in name was not converted to the UID format, so the code
could never find the relevant data.
2020-06-02 17:05:36 -07:00
Aleksandr Melnikov
1390d4d235 Updating error reporting to always return the source error.
- If extra errors, add them as text.
2020-06-02 16:18:55 -07:00
Aleksandr Melnikov
bf37713371 Migration fails silently because the insert statement lacked "uid" value. 2020-06-02 16:18:37 -07:00
Andrey Melnikov
88b20d878d update: workflow template created at is selected when listing workflow executions 2020-06-02 15:23:47 -07:00
Andrey Melnikov
6d8ac266a3 chore: created new dev branch to phase out develop. Updated the workflow to push develop branch 2020-06-02 10:33:53 -07:00
Aleksandr Melnikov
6e9ffed843 Adding custom goose binary to dockerfile.
- This will add the goose command with the ".go" migration files.
This is needed to run goose down commands.
goose.go is needed to generate an executable.
2020-06-01 21:30:41 -07:00
Rush Tehrani
20777ed3ce Merge pull request #306 from onepanelio/feat/onepanelio.core.294-last.modified.at
update: Workflow Template now gets a modifiedAt date, and total versi…
2020-06-01 16:40:16 -07:00
Andrey Melnikov
fa68d2bef4 update: Workflow Template now gets a modifiedAt date, and total version count, from the the Get endpoint. 2020-06-01 16:09:35 -07:00
Andrey Melnikov
2726ec8d82 Merge pull request #298 from onepanelio/fix/workspace-update
fix: workspace update waits for correct success condition
2020-06-01 15:28:28 -07:00
Aleksandr Melnikov
a9df73e63a Merge pull request #281 from onepanelio/chore/fix-version
fix: version and names
2020-06-01 12:55:30 -07:00
Rush Tehrani
b8ca62efda Merge pull request #305 from onepanelio/fix/onepanelio.core.304-labels.listing.order
Fix/onepanelio.core.304 labels.listing.order
2020-06-01 12:43:57 -07:00
Andrey Melnikov
afd1b65dc5 fix: issue where labels were not sorted in any order when returned in API 2020-06-01 12:36:34 -07:00
Rush Tehrani
b7f298035d Merge pull request #303 from onepanelio/fix/onepanelio.core.296-workflow.template.count.wrong
fix: issue where workflow template count included system workflow tem…
2020-06-01 11:49:32 -07:00
Andrey Melnikov
90733b5daa fix: issue where workflow template count included system workflow templates. 2020-06-01 11:35:16 -07:00
Aleksandr Melnikov
35aef3819f Changing migrations to use ArchiveWorkspaceTemplate.
Ref: https://github.com/onepanelio/core/pull/286#discussion_r432901056
2020-06-01 10:59:47 -07:00
rushtehrani
bbe5593b52 add version flag to make api 2020-06-01 10:22:48 -07:00
rushtehrani
7911ff02cc check successCondition of statefulset at creation time as well 2020-05-31 23:27:40 -07:00
rushtehrani
f1ecb595b4 fixes workspace update success condition 2020-05-31 22:47:17 -07:00
rushtehrani
010052de3a update cvat images 2020-05-30 18:12:16 -07:00
rushtehrani
56856caa8a update name and rebase 2020-05-30 18:10:47 -07:00
Aleksandr Melnikov
3d3c9d6a66 Removing sleep command.
- Per testing, a migration error does not happen with an Azure deployment.
2020-05-30 18:05:49 -07:00
Aleksandr Melnikov
159d1819b0 Adding migration for CVAT Workspace Template. 2020-05-30 18:05:49 -07:00
Rush Tehrani
5597e14985 Merge pull request #260 from onepanelio/feature/add.jupyter.lab.to.workspace.templates
feature: added migration with jupyterlab
2020-05-30 18:03:54 -07:00
rushtehrani
7b570f861e fix db connection 2020-05-30 17:59:02 -07:00
Rush Tehrani
c6c2079226 Merge pull request #295 from onepanelio/fix/onepanelio.core.292-workspace.labels.fail
fix: issue where workspace labels did not take into account archived …
2020-05-30 15:53:31 -07:00
Andrey Melnikov
b9d5f24f37 fix: issue where workspace labels did not take into account archived ones. 2020-05-29 21:21:38 -07:00
Rush Tehrani
738d3a0050 Merge pull request #290 from onepanelio/feat/onepanelio.core.282-key.format
update: hard-coded artifacts key format with the new config.
2020-05-29 13:22:33 -07:00
Andrey Melnikov
64f6afc730 fix: replace KeyFormat placeholders with the actual value. 2020-05-29 11:43:13 -07:00
Andrey Melnikov
04bc8f2e12 update: hard-coded artifacts key format with the new config. 2020-05-29 11:27:08 -07:00
Rush Tehrani
67f4634ae0 Merge pull request #284 from onepanelio/fix/onepanelio.core.264-post.execution.workflow.optional
fix: added a default post execution workflow if there wasn't one alre…
2020-05-29 10:05:38 -07:00
Andrey Melnikov
271b1ed563 update: removed default PostExecution and only add the post execution if it exists in the setup 2020-05-28 16:53:16 -07:00
Rush Tehrani
b7c6d33c9e Merge pull request #283 from onepanelio/fix/onepanelio.core.277-sys.send.exit.status
fix: set workspaces dags to be FailFast: false so that even if anothe…
2020-05-28 16:23:55 -07:00
Andrey Melnikov
a138413c5f update: exit handler no longer depends on other exit handlers. This fixes an issue where the user's custom exit handler could crash, leaving ours not executed. 2020-05-28 16:14:16 -07:00
Andrey Melnikov
ca1c672f0d fix: added a default post execution workflow if there wasn't one already. 2020-05-28 13:26:15 -07:00
Andrey Melnikov
b41ddcdc2c fix: set workspaces dags to be FailFast: false so that even if another part of the dag fails, the sys-exit will not. 2020-05-28 12:28:51 -07:00
Andrey Melnikov
48f543b9f6 Merge pull request #280 from onepanelio/fix/onepanelio.278-list.workspace.labels
fix: added labels to list workspace method
2020-05-28 10:23:37 -07:00
Rush Tehrani
e41eb4a087 Merge pull request #269 from onepanelio/feat/core.254-workflow.counts
fix: update archive code to list all the template versions.
2020-05-28 10:17:41 -07:00
rushtehrani
73535da7fa make API 2020-05-28 10:09:08 -07:00
rushtehrani
84ddd0d0da correct API version and name 2020-05-28 10:08:25 -07:00
rushtehrani
7600f79776 update README 2020-05-28 10:08:25 -07:00
Andrey Melnikov
2164b644e6 update: removed snapshot from develop branch for GithubActions 2020-05-28 10:08:25 -07:00
Andrey Melnikov
29e1550446 fix: added labels to list workspace method 2020-05-27 22:44:39 -07:00
Aleksandr Melnikov
f2d8165016 Updating archive code to list all the template versions.
- Iterate through each version and grab the related WorkflowExecutions,
then archive them.
2020-05-26 22:09:25 -07:00
Andrey Melnikov
e8c17a04ee feature: added migration with jupyter lab 2020-05-26 10:45:56 -07:00
132 changed files with 11054 additions and 3515 deletions

View File

@@ -1,8 +1,8 @@
name: Publish develop docker image
name: Publish dev docker image
on:
push:
branches:
- develop
- dev
jobs:
build:
runs-on: ubuntu-latest

26
.github/workflows/run_unit_tests.yaml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Run Unit Tests
on:
push:
branches:
- test/docker.database
jobs:
test-code-job:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.3
env:
POSTGRES_DB: onepanel
POSTGRES_USER: admin
POSTGRES_PASSWORD: tester
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@master
- name: Run testing code
uses: cedrickring/golang-action@1.5.2
with:
args: go test github.com/onepanelio/core/pkg -db=postgres

View File

@@ -49,7 +49,7 @@ Make sure that your `$GOBIN` is in your `$PATH`.
Generate Go and Swagger APIs:
```bash
make api
make api version=1.0.0
```
## Minikube Debugging and Development
@@ -122,6 +122,8 @@ After this, build main.go and run the executable.
## Code Structure & Organization
### `utils` dir
```shell script
utils/*.go
```
@@ -150,4 +152,25 @@ These can be pulled out into their own package or into a new v2 directory if nee
You can add
- kubernetes specific operations
- database specific operations
- types
- types
### `cmd` dir
Each source file here is assumed to result in an executable.
- Hence the `package main` at the top of each
Place each source file into it's own folder.
Example source file name: `flush_cache.go`
- Dir structure: `cmd/flush-cache/flush_cache.go`
To avoid errors like this during docker build
```text
# github.com/onepanelio/core/cmd
cmd/goose.go:22:6: main redeclared in this block
previous declaration at cmd/gen-release-md.go:136:6
github.com/onepanelio/core
```
Caused by
```dockerfile
RUN go install -v ./...
```

View File

@@ -5,11 +5,13 @@ COPY . .
RUN go get -d -v ./...
RUN go install -v ./...
RUN go get -u github.com/pressly/goose/cmd/goose
RUN go build -o /go/bin/goose ./cmd/goose/goose.go
FROM golang:1.13.10
COPY --from=builder /go/bin/core .
COPY --from=builder /go/src/db ./db
COPY --from=builder /go/bin/goose .
EXPOSE 8888
EXPOSE 8887

View File

@@ -1,9 +1,17 @@
COMMIT_HASH=$(shell git rev-parse --short HEAD)
.PHONY: init
init:
ifndef version
$(error version is undefined)
endif
jq:
cat api/apidocs.swagger.json \
| jq 'walk( if type == "object" then with_entries( .key |= sub( "api\\."; "") ) else . end )' \
| jq 'walk( if type == "string" then gsub( "api\\."; "") else . end )' \
| jq '.info.version = "$(version)"' \
> api/api.swagger.json
rm api/apidocs.swagger.json
@@ -16,7 +24,7 @@ protoc:
--grpc-gateway_out=logtostderr=true,allow_delete_body=true:api \
--swagger_out=allow_merge=true,fqn_for_swagger_name=true,allow_delete_body=true,logtostderr=true,simple_operation_ids=true:api
api: protoc jq
api: init protoc jq
docker-build:
docker build -t onepanel-core .
@@ -26,3 +34,8 @@ docker-push:
docker push onepanel/core:$(COMMIT_HASH)
docker: docker-build docker-push
run-tests:
docker run --rm --name test-onepanel-postgres -p 5432:5432 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=tester -e POSTGRES_DB=onepanel -d postgres:12.3
go test github.com/onepanelio/core/pkg -count=1 ||:
docker stop test-onepanel-postgres

View File

@@ -31,25 +31,25 @@ var file_api_proto_rawDesc = []byte{
0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70, 0x69,
0x1a, 0x2c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x73, 0x77, 0x61,
0x67, 0x67, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e,
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x8b,
0x02, 0x92, 0x41, 0x87, 0x02, 0x12, 0x74, 0x0a, 0x0d, 0x4f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65,
0x6c, 0x20, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x19, 0x4f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c,
0x20, 0x43, 0x6f, 0x72, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50,
0x49, 0x22, 0x3b, 0x0a, 0x15, 0x4f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x20, 0x43, 0x6f,
0x72, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x22, 0x68, 0x74, 0x74, 0x70,
0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f,
0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x32, 0x0b,
0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2d, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x0e, 0x6c, 0x6f, 0x63,
0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x3a, 0x38, 0x38, 0x38, 0x38, 0x2a, 0x02, 0x01, 0x02, 0x32,
0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f,
0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a,
0x73, 0x6f, 0x6e, 0x5a, 0x49, 0x0a, 0x47, 0x0a, 0x06, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12,
0x3d, 0x08, 0x02, 0x12, 0x28, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69,
0x78, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x1a, 0x0d, 0x61,
0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x62, 0x0c,
0x0a, 0x0a, 0x0a, 0x06, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x89,
0x02, 0x92, 0x41, 0x85, 0x02, 0x12, 0x58, 0x0a, 0x08, 0x4f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65,
0x6c, 0x12, 0x0c, 0x4f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x20, 0x41, 0x50, 0x49, 0x22,
0x36, 0x0a, 0x10, 0x4f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x20, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x12, 0x22, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c,
0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x32, 0x06, 0x30, 0x2e, 0x31, 0x30, 0x2e, 0x30, 0x1a,
0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x3a, 0x38, 0x38, 0x38, 0x38, 0x2a,
0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x18, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x5a, 0x49, 0x0a, 0x47, 0x0a, 0x06, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x3d, 0x08,
0x02, 0x12, 0x28, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65,
0x64, 0x20, 0x62, 0x79, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x1a, 0x0d, 0x61, 0x75, 0x74,
0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x62, 0x0c, 0x0a, 0x0a,
0x0a, 0x06, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var file_api_proto_goTypes = []interface{}{}

View File

@@ -6,11 +6,11 @@ import "protoc-gen-swagger/options/annotations.proto";
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
info: {
title: "Onepanel Core";
description: "Onepanel Core project API";
version: "1.0.0-beta1";
title: "Onepanel";
description: "Onepanel API";
version: "0.10.0";
contact: {
name: "Onepanel Core project";
name: "Onepanel project";
url: "https://github.com/onepanelio/core";
};
};
@@ -19,6 +19,7 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
produces: "application/octet-stream";
security_definitions: {
security: {
key: "Bearer";

View File

@@ -1,11 +1,11 @@
{
"swagger": "2.0",
"info": {
"title": "Onepanel Core",
"description": "Onepanel Core project API",
"version": "1.0.0-beta1",
"title": "Onepanel",
"description": "Onepanel API",
"version": "0.12.0-rc.0",
"contact": {
"name": "Onepanel Core project",
"name": "Onepanel project",
"url": "https://github.com/onepanelio/core"
}
},
@@ -18,7 +18,8 @@
"application/json"
],
"produces": [
"application/json"
"application/json",
"application/octet-stream"
],
"paths": {
"/apis/v1beta1/auth": {
@@ -38,6 +39,16 @@
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/IsAuthorized"
}
}
],
"tags": [
"AuthService"
]
@@ -75,6 +86,28 @@
]
}
},
"/apis/v1beta1/config": {
"get": {
"operationId": "GetConfig",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/GetConfigResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/grpc.gateway.runtime.Error"
}
}
},
"tags": [
"ConfigService"
]
}
},
"/apis/v1beta1/namespaces": {
"get": {
"operationId": "ListNamespaces",
@@ -701,6 +734,86 @@
]
}
},
"/apis/v1beta1/{namespace}/service": {
"get": {
"operationId": "ListServices",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/ListServicesResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/grpc.gateway.runtime.Error"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "pageSize",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "page",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
}
],
"tags": [
"ServiceService"
]
}
},
"/apis/v1beta1/{namespace}/service/{name}": {
"get": {
"operationId": "GetService",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/Service"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/grpc.gateway.runtime.Error"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"ServiceService"
]
}
},
"/apis/v1beta1/{namespace}/workflow_executions": {
"get": {
"operationId": "ListWorkflowExecutions",
@@ -1332,6 +1445,12 @@
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "labels",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
@@ -1675,57 +1794,6 @@
]
}
},
"/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions/{workflowTemplate.version}": {
"put": {
"operationId": "UpdateWorkflowTemplateVersion",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/WorkflowTemplate"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/grpc.gateway.runtime.Error"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "workflowTemplate.uid",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "workflowTemplate.version",
"in": "path",
"required": true,
"type": "string",
"format": "int64"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/WorkflowTemplate"
}
}
],
"tags": [
"WorkflowTemplateService"
]
}
},
"/apis/v1beta1/{namespace}/workspace_templates": {
"get": {
"operationId": "ListWorkspaceTemplates",
@@ -2658,6 +2726,23 @@
}
}
},
"GetConfigResponse": {
"type": "object",
"properties": {
"apiUrl": {
"type": "string"
},
"domain": {
"type": "string"
},
"fqdn": {
"type": "string"
},
"nodePool": {
"$ref": "#/definitions/NodePool"
}
}
},
"GetLabelsResponse": {
"type": "object",
"properties": {
@@ -2680,6 +2765,26 @@
}
}
},
"IsAuthorized": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"verb": {
"type": "string"
},
"group": {
"type": "string"
},
"resource": {
"type": "string"
},
"resourceName": {
"type": "string"
}
}
},
"IsAuthorizedResponse": {
"type": "object",
"properties": {
@@ -2802,6 +2907,33 @@
}
}
},
"ListServicesResponse": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"format": "int32"
},
"services": {
"type": "array",
"items": {
"$ref": "#/definitions/Service"
}
},
"page": {
"type": "integer",
"format": "int32"
},
"pages": {
"type": "integer",
"format": "int32"
},
"totalCount": {
"type": "integer",
"format": "int32"
}
}
},
"ListWorkflowExecutionsResponse": {
"type": "object",
"properties": {
@@ -2974,6 +3106,31 @@
}
}
},
"NodePool": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"options": {
"type": "array",
"items": {
"$ref": "#/definitions/NodePoolOption"
}
}
}
},
"NodePoolOption": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"Parameter": {
"type": "object",
"properties": {
@@ -2996,6 +3153,9 @@
"type": "boolean",
"format": "boolean"
},
"visibility": {
"type": "string"
},
"options": {
"type": "array",
"items": {
@@ -3038,6 +3198,17 @@
}
}
},
"Service": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"Statistics": {
"type": "object",
"properties": {
@@ -3122,6 +3293,17 @@
"items": {
"$ref": "#/definitions/KeyValue"
}
},
"metadata": {
"$ref": "#/definitions/WorkflowExecutionMetadata"
}
}
},
"WorkflowExecutionMetadata": {
"type": "object",
"properties": {
"url": {
"type": "string"
}
}
},
@@ -3167,6 +3349,9 @@
"createdAt": {
"type": "string"
},
"modifiedAt": {
"type": "string"
},
"uid": {
"type": "string"
},
@@ -3203,6 +3388,12 @@
},
"cronStats": {
"$ref": "#/definitions/CronWorkflowStatisticsReport"
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/definitions/Parameter"
}
}
}
},
@@ -3303,6 +3494,9 @@
"isArchived": {
"type": "boolean",
"format": "boolean"
},
"description": {
"type": "string"
}
}
},

View File

@@ -9,7 +9,7 @@ package api
import (
context "context"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
_ "github.com/golang/protobuf/ptypes/empty"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -31,7 +31,7 @@ const (
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type IsAuthorizedRequest struct {
type IsAuthorized struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@@ -43,10 +43,85 @@ type IsAuthorizedRequest struct {
ResourceName string `protobuf:"bytes,5,opt,name=resourceName,proto3" json:"resourceName,omitempty"`
}
func (x *IsAuthorized) Reset() {
*x = IsAuthorized{}
if protoimpl.UnsafeEnabled {
mi := &file_auth_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IsAuthorized) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IsAuthorized) ProtoMessage() {}
func (x *IsAuthorized) ProtoReflect() protoreflect.Message {
mi := &file_auth_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IsAuthorized.ProtoReflect.Descriptor instead.
func (*IsAuthorized) Descriptor() ([]byte, []int) {
return file_auth_proto_rawDescGZIP(), []int{0}
}
func (x *IsAuthorized) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *IsAuthorized) GetVerb() string {
if x != nil {
return x.Verb
}
return ""
}
func (x *IsAuthorized) GetGroup() string {
if x != nil {
return x.Group
}
return ""
}
func (x *IsAuthorized) GetResource() string {
if x != nil {
return x.Resource
}
return ""
}
func (x *IsAuthorized) GetResourceName() string {
if x != nil {
return x.ResourceName
}
return ""
}
type IsAuthorizedRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IsAuthorized *IsAuthorized `protobuf:"bytes,1,opt,name=isAuthorized,proto3" json:"isAuthorized,omitempty"`
}
func (x *IsAuthorizedRequest) Reset() {
*x = IsAuthorizedRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_auth_proto_msgTypes[0]
mi := &file_auth_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -59,7 +134,7 @@ func (x *IsAuthorizedRequest) String() string {
func (*IsAuthorizedRequest) ProtoMessage() {}
func (x *IsAuthorizedRequest) ProtoReflect() protoreflect.Message {
mi := &file_auth_proto_msgTypes[0]
mi := &file_auth_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -72,42 +147,14 @@ func (x *IsAuthorizedRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use IsAuthorizedRequest.ProtoReflect.Descriptor instead.
func (*IsAuthorizedRequest) Descriptor() ([]byte, []int) {
return file_auth_proto_rawDescGZIP(), []int{0}
return file_auth_proto_rawDescGZIP(), []int{1}
}
func (x *IsAuthorizedRequest) GetNamespace() string {
func (x *IsAuthorizedRequest) GetIsAuthorized() *IsAuthorized {
if x != nil {
return x.Namespace
return x.IsAuthorized
}
return ""
}
func (x *IsAuthorizedRequest) GetVerb() string {
if x != nil {
return x.Verb
}
return ""
}
func (x *IsAuthorizedRequest) GetGroup() string {
if x != nil {
return x.Group
}
return ""
}
func (x *IsAuthorizedRequest) GetResource() string {
if x != nil {
return x.Resource
}
return ""
}
func (x *IsAuthorizedRequest) GetResourceName() string {
if x != nil {
return x.ResourceName
}
return ""
return nil
}
type IsAuthorizedResponse struct {
@@ -121,7 +168,7 @@ type IsAuthorizedResponse struct {
func (x *IsAuthorizedResponse) Reset() {
*x = IsAuthorizedResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_auth_proto_msgTypes[1]
mi := &file_auth_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -134,7 +181,7 @@ func (x *IsAuthorizedResponse) String() string {
func (*IsAuthorizedResponse) ProtoMessage() {}
func (x *IsAuthorizedResponse) ProtoReflect() protoreflect.Message {
mi := &file_auth_proto_msgTypes[1]
mi := &file_auth_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -147,7 +194,7 @@ func (x *IsAuthorizedResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use IsAuthorizedResponse.ProtoReflect.Descriptor instead.
func (*IsAuthorizedResponse) Descriptor() ([]byte, []int) {
return file_auth_proto_rawDescGZIP(), []int{1}
return file_auth_proto_rawDescGZIP(), []int{2}
}
func (x *IsAuthorizedResponse) GetAuthorized() bool {
@@ -168,7 +215,7 @@ type TokenWrapper struct {
func (x *TokenWrapper) Reset() {
*x = TokenWrapper{}
if protoimpl.UnsafeEnabled {
mi := &file_auth_proto_msgTypes[2]
mi := &file_auth_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -181,7 +228,7 @@ func (x *TokenWrapper) String() string {
func (*TokenWrapper) ProtoMessage() {}
func (x *TokenWrapper) ProtoReflect() protoreflect.Message {
mi := &file_auth_proto_msgTypes[2]
mi := &file_auth_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -194,7 +241,7 @@ func (x *TokenWrapper) ProtoReflect() protoreflect.Message {
// Deprecated: Use TokenWrapper.ProtoReflect.Descriptor instead.
func (*TokenWrapper) Descriptor() ([]byte, []int) {
return file_auth_proto_rawDescGZIP(), []int{2}
return file_auth_proto_rawDescGZIP(), []int{3}
}
func (x *TokenWrapper) GetToken() string {
@@ -215,7 +262,7 @@ type IsValidTokenRequest struct {
func (x *IsValidTokenRequest) Reset() {
*x = IsValidTokenRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_auth_proto_msgTypes[3]
mi := &file_auth_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -228,7 +275,7 @@ func (x *IsValidTokenRequest) String() string {
func (*IsValidTokenRequest) ProtoMessage() {}
func (x *IsValidTokenRequest) ProtoReflect() protoreflect.Message {
mi := &file_auth_proto_msgTypes[3]
mi := &file_auth_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -241,7 +288,7 @@ func (x *IsValidTokenRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use IsValidTokenRequest.ProtoReflect.Descriptor instead.
func (*IsValidTokenRequest) Descriptor() ([]byte, []int) {
return file_auth_proto_rawDescGZIP(), []int{3}
return file_auth_proto_rawDescGZIP(), []int{4}
}
func (x *IsValidTokenRequest) GetToken() *TokenWrapper {
@@ -262,7 +309,7 @@ type IsValidTokenResponse struct {
func (x *IsValidTokenResponse) Reset() {
*x = IsValidTokenResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_auth_proto_msgTypes[4]
mi := &file_auth_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -275,7 +322,7 @@ func (x *IsValidTokenResponse) String() string {
func (*IsValidTokenResponse) ProtoMessage() {}
func (x *IsValidTokenResponse) ProtoReflect() protoreflect.Message {
mi := &file_auth_proto_msgTypes[4]
mi := &file_auth_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -288,7 +335,7 @@ func (x *IsValidTokenResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use IsValidTokenResponse.ProtoReflect.Descriptor instead.
func (*IsValidTokenResponse) Descriptor() ([]byte, []int) {
return file_auth_proto_rawDescGZIP(), []int{4}
return file_auth_proto_rawDescGZIP(), []int{5}
}
func (x *IsValidTokenResponse) GetDomain() string {
@@ -298,77 +345,6 @@ func (x *IsValidTokenResponse) GetDomain() string {
return ""
}
type IsWorkspaceAuthenticatedRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FQDN string `protobuf:"bytes,1,opt,name=FQDN,proto3" json:"FQDN,omitempty"`
XOriginalMethod string `protobuf:"bytes,2,opt,name=XOriginalMethod,proto3" json:"XOriginalMethod,omitempty"`
XOriginalAuthority string `protobuf:"bytes,3,opt,name=XOriginalAuthority,proto3" json:"XOriginalAuthority,omitempty"`
XOriginalUri string `protobuf:"bytes,4,opt,name=XOriginalUri,proto3" json:"XOriginalUri,omitempty"`
}
func (x *IsWorkspaceAuthenticatedRequest) Reset() {
*x = IsWorkspaceAuthenticatedRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_auth_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IsWorkspaceAuthenticatedRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IsWorkspaceAuthenticatedRequest) ProtoMessage() {}
func (x *IsWorkspaceAuthenticatedRequest) ProtoReflect() protoreflect.Message {
mi := &file_auth_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IsWorkspaceAuthenticatedRequest.ProtoReflect.Descriptor instead.
func (*IsWorkspaceAuthenticatedRequest) Descriptor() ([]byte, []int) {
return file_auth_proto_rawDescGZIP(), []int{5}
}
func (x *IsWorkspaceAuthenticatedRequest) GetFQDN() string {
if x != nil {
return x.FQDN
}
return ""
}
func (x *IsWorkspaceAuthenticatedRequest) GetXOriginalMethod() string {
if x != nil {
return x.XOriginalMethod
}
return ""
}
func (x *IsWorkspaceAuthenticatedRequest) GetXOriginalAuthority() string {
if x != nil {
return x.XOriginalAuthority
}
return ""
}
func (x *IsWorkspaceAuthenticatedRequest) GetXOriginalUri() string {
if x != nil {
return x.XOriginalUri
}
return ""
}
var File_auth_proto protoreflect.FileDescriptor
var file_auth_proto_rawDesc = []byte{
@@ -376,64 +352,50 @@ var file_auth_proto_rawDesc = []byte{
0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x01, 0x0a,
0x13, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x65, 0x72, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x0a, 0x08,
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x36, 0x0a, 0x14,
0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96, 0x01, 0x0a,
0x0c, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x1c, 0x0a,
0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76,
0x65, 0x72, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12,
0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x13, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f,
0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0c,
0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f,
0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x0c, 0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
0x7a, 0x65, 0x64, 0x22, 0x36, 0x0a, 0x14, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
0x7a, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61,
0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x24, 0x0a, 0x0c, 0x54,
0x6f, 0x6b, 0x65, 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74,
0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65,
0x6e, 0x22, 0x3e, 0x0a, 0x13, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x6f,
0x6b, 0x65, 0x6e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65,
0x6e, 0x22, 0x2e, 0x0a, 0x14, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d,
0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69,
0x6e, 0x32, 0xea, 0x01, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x12, 0x6c, 0x0a, 0x0c, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54,
0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x18,
0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x75,
0x74, 0x68, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
0x6d, 0x0a, 0x0c, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12,
0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a,
0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72,
0x69, 0x7a, 0x65, 0x64, 0x22, 0x24, 0x0a, 0x0c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x57, 0x72, 0x61,
0x70, 0x70, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3e, 0x0a, 0x13, 0x49, 0x73,
0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x27, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x57, 0x72, 0x61, 0x70,
0x70, 0x65, 0x72, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2e, 0x0a, 0x14, 0x49, 0x73,
0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0xb3, 0x01, 0x0a, 0x1f, 0x49,
0x73, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e,
0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12,
0x0a, 0x04, 0x46, 0x51, 0x44, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x46, 0x51,
0x44, 0x4e, 0x12, 0x28, 0x0a, 0x0f, 0x58, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4d,
0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x58, 0x4f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2e, 0x0a, 0x12,
0x58, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x58, 0x4f, 0x72, 0x69, 0x67, 0x69,
0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0c,
0x58, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x55, 0x72, 0x69, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0c, 0x58, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x55, 0x72, 0x69,
0x32, 0xe1, 0x02, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x12, 0x6c, 0x0a, 0x0c, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f,
0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x18, 0x2f,
0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x75, 0x74,
0x68, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x82,
0x01, 0x0a, 0x18, 0x49, 0x73, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x41, 0x75,
0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x24, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x49, 0x73, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x41, 0x75, 0x74,
0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x22, 0x42, 0x20, 0x0a, 0x04, 0x48, 0x45, 0x41, 0x44, 0x12, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x73,
0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x74, 0x6f,
0x6b, 0x65, 0x6e, 0x12, 0x5f, 0x0a, 0x0c, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
0x7a, 0x65, 0x64, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68,
0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14,
0x22, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f,
0x61, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x22, 0x12, 0x2f, 0x61,
0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68,
0x3a, 0x0c, 0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -450,27 +412,25 @@ func file_auth_proto_rawDescGZIP() []byte {
var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_auth_proto_goTypes = []interface{}{
(*IsAuthorizedRequest)(nil), // 0: api.IsAuthorizedRequest
(*IsAuthorizedResponse)(nil), // 1: api.IsAuthorizedResponse
(*TokenWrapper)(nil), // 2: api.TokenWrapper
(*IsValidTokenRequest)(nil), // 3: api.IsValidTokenRequest
(*IsValidTokenResponse)(nil), // 4: api.IsValidTokenResponse
(*IsWorkspaceAuthenticatedRequest)(nil), // 5: api.IsWorkspaceAuthenticatedRequest
(*empty.Empty)(nil), // 6: google.protobuf.Empty
(*IsAuthorized)(nil), // 0: api.IsAuthorized
(*IsAuthorizedRequest)(nil), // 1: api.IsAuthorizedRequest
(*IsAuthorizedResponse)(nil), // 2: api.IsAuthorizedResponse
(*TokenWrapper)(nil), // 3: api.TokenWrapper
(*IsValidTokenRequest)(nil), // 4: api.IsValidTokenRequest
(*IsValidTokenResponse)(nil), // 5: api.IsValidTokenResponse
}
var file_auth_proto_depIdxs = []int32{
2, // 0: api.IsValidTokenRequest.token:type_name -> api.TokenWrapper
3, // 1: api.AuthService.IsValidToken:input_type -> api.IsValidTokenRequest
5, // 2: api.AuthService.IsWorkspaceAuthenticated:input_type -> api.IsWorkspaceAuthenticatedRequest
0, // 3: api.AuthService.IsAuthorized:input_type -> api.IsAuthorizedRequest
4, // 4: api.AuthService.IsValidToken:output_type -> api.IsValidTokenResponse
6, // 5: api.AuthService.IsWorkspaceAuthenticated:output_type -> google.protobuf.Empty
1, // 6: api.AuthService.IsAuthorized:output_type -> api.IsAuthorizedResponse
4, // [4:7] is the sub-list for method output_type
1, // [1:4] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
0, // 0: api.IsAuthorizedRequest.isAuthorized:type_name -> api.IsAuthorized
3, // 1: api.IsValidTokenRequest.token:type_name -> api.TokenWrapper
4, // 2: api.AuthService.IsValidToken:input_type -> api.IsValidTokenRequest
1, // 3: api.AuthService.IsAuthorized:input_type -> api.IsAuthorizedRequest
5, // 4: api.AuthService.IsValidToken:output_type -> api.IsValidTokenResponse
2, // 5: api.AuthService.IsAuthorized:output_type -> api.IsAuthorizedResponse
4, // [4:6] is the sub-list for method output_type
2, // [2:4] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_auth_proto_init() }
@@ -480,7 +440,7 @@ func file_auth_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IsAuthorizedRequest); i {
switch v := v.(*IsAuthorized); i {
case 0:
return &v.state
case 1:
@@ -492,7 +452,7 @@ func file_auth_proto_init() {
}
}
file_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IsAuthorizedResponse); i {
switch v := v.(*IsAuthorizedRequest); i {
case 0:
return &v.state
case 1:
@@ -504,7 +464,7 @@ func file_auth_proto_init() {
}
}
file_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TokenWrapper); i {
switch v := v.(*IsAuthorizedResponse); i {
case 0:
return &v.state
case 1:
@@ -516,7 +476,7 @@ func file_auth_proto_init() {
}
}
file_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IsValidTokenRequest); i {
switch v := v.(*TokenWrapper); i {
case 0:
return &v.state
case 1:
@@ -528,7 +488,7 @@ func file_auth_proto_init() {
}
}
file_auth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IsValidTokenResponse); i {
switch v := v.(*IsValidTokenRequest); i {
case 0:
return &v.state
case 1:
@@ -540,7 +500,7 @@ func file_auth_proto_init() {
}
}
file_auth_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*IsWorkspaceAuthenticatedRequest); i {
switch v := v.(*IsValidTokenResponse); i {
case 0:
return &v.state
case 1:
@@ -585,7 +545,6 @@ const _ = grpc.SupportPackageIsVersion6
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type AuthServiceClient interface {
IsValidToken(ctx context.Context, in *IsValidTokenRequest, opts ...grpc.CallOption) (*IsValidTokenResponse, error)
IsWorkspaceAuthenticated(ctx context.Context, in *IsWorkspaceAuthenticatedRequest, opts ...grpc.CallOption) (*empty.Empty, error)
IsAuthorized(ctx context.Context, in *IsAuthorizedRequest, opts ...grpc.CallOption) (*IsAuthorizedResponse, error)
}
@@ -606,15 +565,6 @@ func (c *authServiceClient) IsValidToken(ctx context.Context, in *IsValidTokenRe
return out, nil
}
func (c *authServiceClient) IsWorkspaceAuthenticated(ctx context.Context, in *IsWorkspaceAuthenticatedRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/api.AuthService/IsWorkspaceAuthenticated", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) IsAuthorized(ctx context.Context, in *IsAuthorizedRequest, opts ...grpc.CallOption) (*IsAuthorizedResponse, error) {
out := new(IsAuthorizedResponse)
err := c.cc.Invoke(ctx, "/api.AuthService/IsAuthorized", in, out, opts...)
@@ -627,7 +577,6 @@ func (c *authServiceClient) IsAuthorized(ctx context.Context, in *IsAuthorizedRe
// AuthServiceServer is the server API for AuthService service.
type AuthServiceServer interface {
IsValidToken(context.Context, *IsValidTokenRequest) (*IsValidTokenResponse, error)
IsWorkspaceAuthenticated(context.Context, *IsWorkspaceAuthenticatedRequest) (*empty.Empty, error)
IsAuthorized(context.Context, *IsAuthorizedRequest) (*IsAuthorizedResponse, error)
}
@@ -638,9 +587,6 @@ type UnimplementedAuthServiceServer struct {
func (*UnimplementedAuthServiceServer) IsValidToken(context.Context, *IsValidTokenRequest) (*IsValidTokenResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IsValidToken not implemented")
}
func (*UnimplementedAuthServiceServer) IsWorkspaceAuthenticated(context.Context, *IsWorkspaceAuthenticatedRequest) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method IsWorkspaceAuthenticated not implemented")
}
func (*UnimplementedAuthServiceServer) IsAuthorized(context.Context, *IsAuthorizedRequest) (*IsAuthorizedResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IsAuthorized not implemented")
}
@@ -667,24 +613,6 @@ func _AuthService_IsValidToken_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _AuthService_IsWorkspaceAuthenticated_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IsWorkspaceAuthenticatedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).IsWorkspaceAuthenticated(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.AuthService/IsWorkspaceAuthenticated",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).IsWorkspaceAuthenticated(ctx, req.(*IsWorkspaceAuthenticatedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_IsAuthorized_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IsAuthorizedRequest)
if err := dec(in); err != nil {
@@ -711,10 +639,6 @@ var _AuthService_serviceDesc = grpc.ServiceDesc{
MethodName: "IsValidToken",
Handler: _AuthService_IsValidToken_Handler,
},
{
MethodName: "IsWorkspaceAuthenticated",
Handler: _AuthService_IsWorkspaceAuthenticated_Handler,
},
{
MethodName: "IsAuthorized",
Handler: _AuthService_IsAuthorized_Handler,

View File

@@ -65,51 +65,15 @@ func local_request_AuthService_IsValidToken_0(ctx context.Context, marshaler run
}
var (
filter_AuthService_IsWorkspaceAuthenticated_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_AuthService_IsWorkspaceAuthenticated_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq IsWorkspaceAuthenticatedRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_IsWorkspaceAuthenticated_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.IsWorkspaceAuthenticated(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AuthService_IsWorkspaceAuthenticated_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq IsWorkspaceAuthenticatedRequest
var metadata runtime.ServerMetadata
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AuthService_IsWorkspaceAuthenticated_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.IsWorkspaceAuthenticated(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_AuthService_IsAuthorized_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_AuthService_IsAuthorized_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq IsAuthorizedRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_IsAuthorized_0); err != nil {
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IsAuthorized); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -122,7 +86,11 @@ func local_request_AuthService_IsAuthorized_0(ctx context.Context, marshaler run
var protoReq IsAuthorizedRequest
var metadata runtime.ServerMetadata
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_AuthService_IsAuthorized_0); err != nil {
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IsAuthorized); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -156,26 +124,6 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("HEAD", pattern_AuthService_IsWorkspaceAuthenticated_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AuthService_IsWorkspaceAuthenticated_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_IsWorkspaceAuthenticated_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_AuthService_IsAuthorized_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -257,26 +205,6 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
})
mux.Handle("HEAD", pattern_AuthService_IsWorkspaceAuthenticated_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_IsWorkspaceAuthenticated_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_IsWorkspaceAuthenticated_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_AuthService_IsAuthorized_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -303,15 +231,11 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
var (
pattern_AuthService_IsValidToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"apis", "v1beta1", "auth", "token"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_AuthService_IsWorkspaceAuthenticated_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"apis", "v1beta1", "auth", "token"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_AuthService_IsAuthorized_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "auth"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
forward_AuthService_IsValidToken_0 = runtime.ForwardResponseMessage
forward_AuthService_IsWorkspaceAuthenticated_0 = runtime.ForwardResponseMessage
forward_AuthService_IsAuthorized_0 = runtime.ForwardResponseMessage
)

View File

@@ -13,23 +13,15 @@ service AuthService {
};
}
rpc IsWorkspaceAuthenticated(IsWorkspaceAuthenticatedRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
custom: {
kind: "HEAD"
path: "/apis/v1beta1/auth/token"
}
};
}
rpc IsAuthorized(IsAuthorizedRequest) returns (IsAuthorizedResponse) {
option (google.api.http) = {
post: "/apis/v1beta1/auth"
post: "/apis/v1beta1/auth",
body: "isAuthorized"
};
}
}
message IsAuthorizedRequest {
message IsAuthorized {
string namespace = 1;
string verb = 2;
string group = 3;
@@ -37,6 +29,10 @@ message IsAuthorizedRequest {
string resourceName = 5;
}
message IsAuthorizedRequest {
IsAuthorized isAuthorized = 1;
}
message IsAuthorizedResponse {
bool authorized = 1;
}
@@ -51,11 +47,4 @@ message IsValidTokenRequest {
message IsValidTokenResponse {
string domain = 1;
}
message IsWorkspaceAuthenticatedRequest {
string FQDN = 1;
string XOriginalMethod = 2;
string XOriginalAuthority = 3;
string XOriginalUri = 4;
}

View File

@@ -36,7 +36,8 @@ type Parameter struct {
DisplayName string `protobuf:"bytes,4,opt,name=displayName,proto3" json:"displayName,omitempty"`
Hint string `protobuf:"bytes,5,opt,name=hint,proto3" json:"hint,omitempty"`
Required bool `protobuf:"varint,6,opt,name=required,proto3" json:"required,omitempty"`
Options []*ParameterOption `protobuf:"bytes,7,rep,name=options,proto3" json:"options,omitempty"`
Visibility string `protobuf:"bytes,7,opt,name=visibility,proto3" json:"visibility,omitempty"`
Options []*ParameterOption `protobuf:"bytes,8,rep,name=options,proto3" json:"options,omitempty"`
}
func (x *Parameter) Reset() {
@@ -113,6 +114,13 @@ func (x *Parameter) GetRequired() bool {
return false
}
func (x *Parameter) GetVisibility() string {
if x != nil {
return x.Visibility
}
return ""
}
func (x *Parameter) GetOptions() []*ParameterOption {
if x != nil {
return x.Options
@@ -179,7 +187,7 @@ var File_common_proto protoreflect.FileDescriptor
var file_common_proto_rawDesc = []byte{
0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03,
0x61, 0x70, 0x69, 0x22, 0xcb, 0x01, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
0x61, 0x70, 0x69, 0x22, 0xeb, 0x01, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74,
@@ -189,7 +197,9 @@ var file_common_proto_rawDesc = []byte{
0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x68, 0x69, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
0x64, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03,
0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18,
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74,
0x79, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x22, 0x3b, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x4f, 0x70,

View File

@@ -9,8 +9,9 @@ message Parameter {
string displayName = 4;
string hint = 5;
bool required = 6;
string visibility = 7;
repeated ParameterOption options = 7;
repeated ParameterOption options = 8;
}
message ParameterOption {

422
api/config.pb.go Normal file
View File

@@ -0,0 +1,422 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.22.0
// protoc v3.11.4
// source: config.proto
package api
import (
context "context"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type GetConfigResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ApiUrl string `protobuf:"bytes,1,opt,name=apiUrl,proto3" json:"apiUrl,omitempty"`
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
Fqdn string `protobuf:"bytes,3,opt,name=fqdn,proto3" json:"fqdn,omitempty"`
NodePool *NodePool `protobuf:"bytes,4,opt,name=nodePool,proto3" json:"nodePool,omitempty"`
}
func (x *GetConfigResponse) Reset() {
*x = GetConfigResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_config_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetConfigResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetConfigResponse) ProtoMessage() {}
func (x *GetConfigResponse) ProtoReflect() protoreflect.Message {
mi := &file_config_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetConfigResponse.ProtoReflect.Descriptor instead.
func (*GetConfigResponse) Descriptor() ([]byte, []int) {
return file_config_proto_rawDescGZIP(), []int{0}
}
func (x *GetConfigResponse) GetApiUrl() string {
if x != nil {
return x.ApiUrl
}
return ""
}
func (x *GetConfigResponse) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
func (x *GetConfigResponse) GetFqdn() string {
if x != nil {
return x.Fqdn
}
return ""
}
func (x *GetConfigResponse) GetNodePool() *NodePool {
if x != nil {
return x.NodePool
}
return nil
}
type NodePoolOption struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (x *NodePoolOption) Reset() {
*x = NodePoolOption{}
if protoimpl.UnsafeEnabled {
mi := &file_config_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NodePoolOption) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodePoolOption) ProtoMessage() {}
func (x *NodePoolOption) ProtoReflect() protoreflect.Message {
mi := &file_config_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NodePoolOption.ProtoReflect.Descriptor instead.
func (*NodePoolOption) Descriptor() ([]byte, []int) {
return file_config_proto_rawDescGZIP(), []int{1}
}
func (x *NodePoolOption) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NodePoolOption) GetValue() string {
if x != nil {
return x.Value
}
return ""
}
type NodePool struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
Options []*NodePoolOption `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"`
}
func (x *NodePool) Reset() {
*x = NodePool{}
if protoimpl.UnsafeEnabled {
mi := &file_config_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NodePool) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodePool) ProtoMessage() {}
func (x *NodePool) ProtoReflect() protoreflect.Message {
mi := &file_config_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NodePool.ProtoReflect.Descriptor instead.
func (*NodePool) Descriptor() ([]byte, []int) {
return file_config_proto_rawDescGZIP(), []int{2}
}
func (x *NodePool) GetLabel() string {
if x != nil {
return x.Label
}
return ""
}
func (x *NodePool) GetOptions() []*NodePoolOption {
if x != nil {
return x.Options
}
return nil
}
var File_config_proto protoreflect.FileDescriptor
var file_config_proto_rawDesc = []byte{
0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03,
0x61, 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82,
0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x70, 0x69, 0x55, 0x72, 0x6c, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06,
0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f,
0x6d, 0x61, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x64, 0x6e, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x64, 0x6e, 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65,
0x50, 0x6f, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x50,
0x6f, 0x6f, 0x6c, 0x22, 0x3a, 0x0a, 0x0e, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x4f,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22,
0x4f, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c,
0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65,
0x6c, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x6f,
0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x32, 0x6a, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x12, 0x59, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_config_proto_rawDescOnce sync.Once
file_config_proto_rawDescData = file_config_proto_rawDesc
)
func file_config_proto_rawDescGZIP() []byte {
file_config_proto_rawDescOnce.Do(func() {
file_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_proto_rawDescData)
})
return file_config_proto_rawDescData
}
var file_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_config_proto_goTypes = []interface{}{
(*GetConfigResponse)(nil), // 0: api.GetConfigResponse
(*NodePoolOption)(nil), // 1: api.NodePoolOption
(*NodePool)(nil), // 2: api.NodePool
(*empty.Empty)(nil), // 3: google.protobuf.Empty
}
var file_config_proto_depIdxs = []int32{
2, // 0: api.GetConfigResponse.nodePool:type_name -> api.NodePool
1, // 1: api.NodePool.options:type_name -> api.NodePoolOption
3, // 2: api.ConfigService.GetConfig:input_type -> google.protobuf.Empty
0, // 3: api.ConfigService.GetConfig:output_type -> api.GetConfigResponse
3, // [3:4] is the sub-list for method output_type
2, // [2:3] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_config_proto_init() }
func file_config_proto_init() {
if File_config_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetConfigResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NodePoolOption); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NodePool); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_config_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_config_proto_goTypes,
DependencyIndexes: file_config_proto_depIdxs,
MessageInfos: file_config_proto_msgTypes,
}.Build()
File_config_proto = out.File
file_config_proto_rawDesc = nil
file_config_proto_goTypes = nil
file_config_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// ConfigServiceClient is the client API for ConfigService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ConfigServiceClient interface {
GetConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetConfigResponse, error)
}
type configServiceClient struct {
cc grpc.ClientConnInterface
}
func NewConfigServiceClient(cc grpc.ClientConnInterface) ConfigServiceClient {
return &configServiceClient{cc}
}
func (c *configServiceClient) GetConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetConfigResponse, error) {
out := new(GetConfigResponse)
err := c.cc.Invoke(ctx, "/api.ConfigService/GetConfig", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ConfigServiceServer is the server API for ConfigService service.
type ConfigServiceServer interface {
GetConfig(context.Context, *empty.Empty) (*GetConfigResponse, error)
}
// UnimplementedConfigServiceServer can be embedded to have forward compatible implementations.
type UnimplementedConfigServiceServer struct {
}
func (*UnimplementedConfigServiceServer) GetConfig(context.Context, *empty.Empty) (*GetConfigResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented")
}
func RegisterConfigServiceServer(s *grpc.Server, srv ConfigServiceServer) {
s.RegisterService(&_ConfigService_serviceDesc, srv)
}
func _ConfigService_GetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfigServiceServer).GetConfig(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ConfigService/GetConfig",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfigServiceServer).GetConfig(ctx, req.(*empty.Empty))
}
return interceptor(ctx, in, info, handler)
}
var _ConfigService_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.ConfigService",
HandlerType: (*ConfigServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetConfig",
Handler: _ConfigService_GetConfig_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "config.proto",
}

148
api/config.pb.gw.go Normal file
View File

@@ -0,0 +1,148 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: config.proto
/*
Package api is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package api
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/descriptor"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/empty"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage
func request_ConfigService_GetConfig_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq empty.Empty
var metadata runtime.ServerMetadata
msg, err := client.GetConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ConfigService_GetConfig_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq empty.Empty
var metadata runtime.ServerMetadata
msg, err := server.GetConfig(ctx, &protoReq)
return msg, metadata, err
}
// RegisterConfigServiceHandlerServer registers the http handlers for service ConfigService to "mux".
// UnaryRPC :call ConfigServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterConfigServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigServiceServer) error {
mux.Handle("GET", pattern_ConfigService_GetConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ConfigService_GetConfig_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ConfigService_GetConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterConfigServiceHandlerFromEndpoint is same as RegisterConfigServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterConfigServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterConfigServiceHandler(ctx, mux, conn)
}
// RegisterConfigServiceHandler registers the http handlers for service ConfigService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterConfigServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterConfigServiceHandlerClient(ctx, mux, NewConfigServiceClient(conn))
}
// RegisterConfigServiceHandlerClient registers the http handlers for service ConfigService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ConfigServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ConfigServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "ConfigServiceClient" to call the correct interceptors.
func RegisterConfigServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConfigServiceClient) error {
mux.Handle("GET", pattern_ConfigService_GetConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ConfigService_GetConfig_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ConfigService_GetConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_ConfigService_GetConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "config"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
forward_ConfigService_GetConfig_0 = runtime.ForwardResponseMessage
)

31
api/config.proto Normal file
View File

@@ -0,0 +1,31 @@
syntax = "proto3";
package api;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
service ConfigService {
rpc GetConfig (google.protobuf.Empty) returns (GetConfigResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/config"
};
}
}
message GetConfigResponse {
string apiUrl = 1;
string domain = 2;
string fqdn = 3;
NodePool nodePool = 4;
}
message NodePoolOption {
string name = 1;
string value = 2;
}
message NodePool {
string label = 1;
repeated NodePoolOption options = 2;
}

557
api/services.pb.go Normal file
View File

@@ -0,0 +1,557 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.22.0
// protoc v3.11.4
// source: services.proto
package api
import (
context "context"
proto "github.com/golang/protobuf/proto"
_ "github.com/golang/protobuf/ptypes/empty"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type Service struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
}
func (x *Service) Reset() {
*x = Service{}
if protoimpl.UnsafeEnabled {
mi := &file_services_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Service) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Service) ProtoMessage() {}
func (x *Service) ProtoReflect() protoreflect.Message {
mi := &file_services_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Service.ProtoReflect.Descriptor instead.
func (*Service) Descriptor() ([]byte, []int) {
return file_services_proto_rawDescGZIP(), []int{0}
}
func (x *Service) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Service) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
type GetServiceRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *GetServiceRequest) Reset() {
*x = GetServiceRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_services_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetServiceRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetServiceRequest) ProtoMessage() {}
func (x *GetServiceRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetServiceRequest.ProtoReflect.Descriptor instead.
func (*GetServiceRequest) Descriptor() ([]byte, []int) {
return file_services_proto_rawDescGZIP(), []int{1}
}
func (x *GetServiceRequest) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *GetServiceRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
type ListServicesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
}
func (x *ListServicesRequest) Reset() {
*x = ListServicesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_services_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListServicesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListServicesRequest) ProtoMessage() {}
func (x *ListServicesRequest) ProtoReflect() protoreflect.Message {
mi := &file_services_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListServicesRequest.ProtoReflect.Descriptor instead.
func (*ListServicesRequest) Descriptor() ([]byte, []int) {
return file_services_proto_rawDescGZIP(), []int{2}
}
func (x *ListServicesRequest) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
func (x *ListServicesRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListServicesRequest) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
type ListServicesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
Services []*Service `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"`
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
Pages int32 `protobuf:"varint,4,opt,name=pages,proto3" json:"pages,omitempty"`
TotalCount int32 `protobuf:"varint,5,opt,name=totalCount,proto3" json:"totalCount,omitempty"`
}
func (x *ListServicesResponse) Reset() {
*x = ListServicesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_services_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListServicesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListServicesResponse) ProtoMessage() {}
func (x *ListServicesResponse) ProtoReflect() protoreflect.Message {
mi := &file_services_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListServicesResponse.ProtoReflect.Descriptor instead.
func (*ListServicesResponse) Descriptor() ([]byte, []int) {
return file_services_proto_rawDescGZIP(), []int{3}
}
func (x *ListServicesResponse) GetCount() int32 {
if x != nil {
return x.Count
}
return 0
}
func (x *ListServicesResponse) GetServices() []*Service {
if x != nil {
return x.Services
}
return nil
}
func (x *ListServicesResponse) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *ListServicesResponse) GetPages() int32 {
if x != nil {
return x.Pages
}
return 0
}
func (x *ListServicesResponse) GetTotalCount() int32 {
if x != nil {
return x.TotalCount
}
return 0
}
var File_services_proto protoreflect.FileDescriptor
var file_services_proto_rawDesc = []byte{
0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x03, 0x61, 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x22, 0x2f, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72,
0x6c, 0x22, 0x45, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x63, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a,
0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0xa0, 0x01,
0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x08,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61,
0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73,
0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05,
0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74,
0x32, 0xe6, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12,
0x28, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b,
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x6e, 0x0a, 0x0c, 0x4c, 0x69, 0x73,
0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_services_proto_rawDescOnce sync.Once
file_services_proto_rawDescData = file_services_proto_rawDesc
)
func file_services_proto_rawDescGZIP() []byte {
file_services_proto_rawDescOnce.Do(func() {
file_services_proto_rawDescData = protoimpl.X.CompressGZIP(file_services_proto_rawDescData)
})
return file_services_proto_rawDescData
}
var file_services_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_services_proto_goTypes = []interface{}{
(*Service)(nil), // 0: api.Service
(*GetServiceRequest)(nil), // 1: api.GetServiceRequest
(*ListServicesRequest)(nil), // 2: api.ListServicesRequest
(*ListServicesResponse)(nil), // 3: api.ListServicesResponse
}
var file_services_proto_depIdxs = []int32{
0, // 0: api.ListServicesResponse.services:type_name -> api.Service
1, // 1: api.ServiceService.GetService:input_type -> api.GetServiceRequest
2, // 2: api.ServiceService.ListServices:input_type -> api.ListServicesRequest
0, // 3: api.ServiceService.GetService:output_type -> api.Service
3, // 4: api.ServiceService.ListServices:output_type -> api.ListServicesResponse
3, // [3:5] is the sub-list for method output_type
1, // [1:3] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_services_proto_init() }
func file_services_proto_init() {
if File_services_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_services_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Service); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_services_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetServiceRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_services_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListServicesRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_services_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListServicesResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_services_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_services_proto_goTypes,
DependencyIndexes: file_services_proto_depIdxs,
MessageInfos: file_services_proto_msgTypes,
}.Build()
File_services_proto = out.File
file_services_proto_rawDesc = nil
file_services_proto_goTypes = nil
file_services_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// ServiceServiceClient is the client API for ServiceService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ServiceServiceClient interface {
GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error)
ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error)
}
type serviceServiceClient struct {
cc grpc.ClientConnInterface
}
func NewServiceServiceClient(cc grpc.ClientConnInterface) ServiceServiceClient {
return &serviceServiceClient{cc}
}
func (c *serviceServiceClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) {
out := new(Service)
err := c.cc.Invoke(ctx, "/api.ServiceService/GetService", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *serviceServiceClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) {
out := new(ListServicesResponse)
err := c.cc.Invoke(ctx, "/api.ServiceService/ListServices", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ServiceServiceServer is the server API for ServiceService service.
type ServiceServiceServer interface {
GetService(context.Context, *GetServiceRequest) (*Service, error)
ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error)
}
// UnimplementedServiceServiceServer can be embedded to have forward compatible implementations.
type UnimplementedServiceServiceServer struct {
}
func (*UnimplementedServiceServiceServer) GetService(context.Context, *GetServiceRequest) (*Service, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented")
}
func (*UnimplementedServiceServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented")
}
func RegisterServiceServiceServer(s *grpc.Server, srv ServiceServiceServer) {
s.RegisterService(&_ServiceService_serviceDesc, srv)
}
func _ServiceService_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetServiceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceServiceServer).GetService(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ServiceService/GetService",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceServiceServer).GetService(ctx, req.(*GetServiceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ServiceService_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListServicesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceServiceServer).ListServices(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.ServiceService/ListServices",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceServiceServer).ListServices(ctx, req.(*ListServicesRequest))
}
return interceptor(ctx, in, info, handler)
}
var _ServiceService_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.ServiceService",
HandlerType: (*ServiceServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetService",
Handler: _ServiceService_GetService_Handler,
},
{
MethodName: "ListServices",
Handler: _ServiceService_ListServices_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "services.proto",
}

318
api/services.pb.gw.go Normal file
View File

@@ -0,0 +1,318 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: services.proto
/*
Package api is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package api
import (
"context"
"io"
"net/http"
"github.com/golang/protobuf/descriptor"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/status"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage
func request_ServiceService_GetService_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetServiceRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
val, ok = pathParams["name"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
protoReq.Name, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
msg, err := client.GetService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ServiceService_GetService_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetServiceRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
val, ok = pathParams["name"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
protoReq.Name, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
msg, err := server.GetService(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_ServiceService_ListServices_0 = &utilities.DoubleArray{Encoding: map[string]int{"namespace": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
func request_ServiceService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListServicesRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServiceService_ListServices_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ServiceService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListServicesRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ServiceService_ListServices_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListServices(ctx, &protoReq)
return msg, metadata, err
}
// RegisterServiceServiceHandlerServer registers the http handlers for service ServiceService to "mux".
// UnaryRPC :call ServiceServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterServiceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServiceServer) error {
mux.Handle("GET", pattern_ServiceService_GetService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ServiceService_GetService_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ServiceService_GetService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ServiceService_ListServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ServiceService_ListServices_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ServiceService_ListServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterServiceServiceHandlerFromEndpoint is same as RegisterServiceServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterServiceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterServiceServiceHandler(ctx, mux, conn)
}
// RegisterServiceServiceHandler registers the http handlers for service ServiceService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterServiceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterServiceServiceHandlerClient(ctx, mux, NewServiceServiceClient(conn))
}
// RegisterServiceServiceHandlerClient registers the http handlers for service ServiceService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "ServiceServiceClient" to call the correct interceptors.
func RegisterServiceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceServiceClient) error {
mux.Handle("GET", pattern_ServiceService_GetService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ServiceService_GetService_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ServiceService_GetService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ServiceService_ListServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ServiceService_ListServices_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_ServiceService_ListServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_ServiceService_GetService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "service", "name"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_ServiceService_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "service"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
forward_ServiceService_GetService_0 = runtime.ForwardResponseMessage
forward_ServiceService_ListServices_0 = runtime.ForwardResponseMessage
)

44
api/services.proto Normal file
View File

@@ -0,0 +1,44 @@
syntax = "proto3";
package api;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
service ServiceService {
rpc GetService(GetServiceRequest) returns (Service) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/service/{name}"
};
}
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/service"
};
}
}
message Service {
string name = 1;
string url = 2;
}
message GetServiceRequest {
string namespace = 1;
string name = 2;
}
message ListServicesRequest {
string namespace = 1;
int32 pageSize = 2;
int32 page = 3;
}
message ListServicesResponse {
int32 count = 1;
repeated Service services = 2;
int32 page = 3;
int32 pages = 4;
int32 totalCount = 5;
}

File diff suppressed because it is too large Load Diff

View File

@@ -184,6 +184,10 @@ message LogEntry {
string content = 2;
}
message WorkflowExecutionMetadata {
string url = 1;
}
message WorkflowExecution {
string createdAt = 1;
string uid = 2;
@@ -198,6 +202,8 @@ message WorkflowExecution {
WorkflowTemplate workflowTemplate = 9;
repeated KeyValue labels = 10;
WorkflowExecutionMetadata metadata = 11;
}
message ArtifactResponse {

View File

@@ -392,6 +392,7 @@ type ListWorkflowTemplatesRequest struct {
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
Labels string `protobuf:"bytes,4,opt,name=labels,proto3" json:"labels,omitempty"`
}
func (x *ListWorkflowTemplatesRequest) Reset() {
@@ -447,6 +448,13 @@ func (x *ListWorkflowTemplatesRequest) GetPage() int32 {
return 0
}
func (x *ListWorkflowTemplatesRequest) GetLabels() string {
if x != nil {
return x.Labels
}
return ""
}
type ListWorkflowTemplatesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -768,16 +776,18 @@ type WorkflowTemplate struct {
unknownFields protoimpl.UnknownFields
CreatedAt string `protobuf:"bytes,1,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
Versions int64 `protobuf:"varint,5,opt,name=versions,proto3" json:"versions,omitempty"`
Manifest string `protobuf:"bytes,6,opt,name=manifest,proto3" json:"manifest,omitempty"`
IsLatest bool `protobuf:"varint,7,opt,name=isLatest,proto3" json:"isLatest,omitempty"`
IsArchived bool `protobuf:"varint,8,opt,name=isArchived,proto3" json:"isArchived,omitempty"`
Labels []*KeyValue `protobuf:"bytes,9,rep,name=labels,proto3" json:"labels,omitempty"`
Stats *WorkflowExecutionStatisticReport `protobuf:"bytes,10,opt,name=stats,proto3" json:"stats,omitempty"`
CronStats *CronWorkflowStatisticsReport `protobuf:"bytes,11,opt,name=cronStats,proto3" json:"cronStats,omitempty"`
ModifiedAt string `protobuf:"bytes,2,opt,name=modifiedAt,proto3" json:"modifiedAt,omitempty"`
Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"`
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
Version int64 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"`
Versions int64 `protobuf:"varint,6,opt,name=versions,proto3" json:"versions,omitempty"`
Manifest string `protobuf:"bytes,7,opt,name=manifest,proto3" json:"manifest,omitempty"`
IsLatest bool `protobuf:"varint,8,opt,name=isLatest,proto3" json:"isLatest,omitempty"`
IsArchived bool `protobuf:"varint,9,opt,name=isArchived,proto3" json:"isArchived,omitempty"`
Labels []*KeyValue `protobuf:"bytes,10,rep,name=labels,proto3" json:"labels,omitempty"`
Stats *WorkflowExecutionStatisticReport `protobuf:"bytes,11,opt,name=stats,proto3" json:"stats,omitempty"`
CronStats *CronWorkflowStatisticsReport `protobuf:"bytes,12,opt,name=cronStats,proto3" json:"cronStats,omitempty"`
Parameters []*Parameter `protobuf:"bytes,13,rep,name=parameters,proto3" json:"parameters,omitempty"`
}
func (x *WorkflowTemplate) Reset() {
@@ -819,6 +829,13 @@ func (x *WorkflowTemplate) GetCreatedAt() string {
return ""
}
func (x *WorkflowTemplate) GetModifiedAt() string {
if x != nil {
return x.ModifiedAt
}
return ""
}
func (x *WorkflowTemplate) GetUid() string {
if x != nil {
return x.Uid
@@ -889,6 +906,13 @@ func (x *WorkflowTemplate) GetCronStats() *CronWorkflowStatisticsReport {
return nil
}
func (x *WorkflowTemplate) GetParameters() []*Parameter {
if x != nil {
return x.Parameters
}
return nil
}
type GetWorkflowTemplateLabelsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -959,230 +983,223 @@ var file_workflow_template_proto_rawDesc = []byte{
0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70, 0x69, 0x1a, 0x1c,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0b, 0x6c, 0x61,
0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x1d, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e,
0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x77, 0x6f, 0x72,
0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x87, 0x01, 0x0a,
0x24, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x66, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72,
0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18,
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x7c,
0x0a, 0x1c, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c,
0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03,
0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20,
0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x55, 0x0a, 0x23,
0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75,
0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d,
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61,
0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x24, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x75, 0x69, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x12, 0x43, 0x0a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x22, 0x6c, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x57,
0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0xc4, 0x01, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x43, 0x0a,
0x11, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57,
0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52,
0x11, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x18,
0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a,
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x50, 0x0a, 0x1e,
0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c,
0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03,
0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x64,
0x0a, 0x1f, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f,
0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x41, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x22, 0xcc, 0x01, 0x0a, 0x20, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f,
0x77, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73,
0x74, 0x69, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74,
0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12,
0x22, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75,
0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x03,
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a,
0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66,
0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x61, 0x69,
0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65,
0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61,
0x74, 0x65, 0x64, 0x22, 0x34, 0x0a, 0x1c, 0x43, 0x72, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x70,
0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x89, 0x03, 0x0a, 0x10, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x1c,
0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x10, 0x0a, 0x03,
0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20,
0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08,
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69,
0x66, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x61, 0x6e, 0x69,
0x66, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74,
0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74,
0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x18, 0x08,
0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64,
0x12, 0x25, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x3b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73,
0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72,
0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74,
0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x05, 0x73,
0x74, 0x61, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x09, 0x63, 0x72, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74,
0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72,
0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73,
0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x09, 0x63, 0x72, 0x6f, 0x6e,
0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0x6e, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65,
0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d,
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61,
0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0xa3, 0x0c, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x12, 0x9b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f,
0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x46, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x40, 0x22,
0x2c, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b,
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x3a, 0x10, 0x77,
0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12,
0xe5, 0x01, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x22, 0x81, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x7b, 0x1a, 0x67, 0x2f, 0x61,
0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77,
0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x77, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x75, 0x69, 0x64,
0x7d, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x77, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x3a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0xc2, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x22, 0x66, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x60, 0x22, 0x4c, 0x2f, 0x61,
0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77,
0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x77, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x75, 0x69, 0x64,
0x7d, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x10, 0x77, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0xd3, 0x01, 0x0a,
0x13, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x83, 0x01, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x7d, 0x12, 0x32, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62,
0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d,
0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x5a, 0x47, 0x12, 0x45, 0x2f, 0x61, 0x70,
0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f,
0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f,
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x7d, 0x12, 0xb8, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d,
0x12, 0x3b, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f,
0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b,
0x75, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x94, 0x01,
0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69,
0x6c, 0x61, 0x74, 0x65, 0x22, 0x66, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75,
0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20,
0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x7c, 0x0a, 0x1c,
0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09,
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x55, 0x0a, 0x23, 0x4c, 0x69,
0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31,
0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69,
0x64, 0x22, 0x81, 0x01, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x12, 0x43, 0x0a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,
0x70, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0xc4, 0x01, 0x0a,
0x1d, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x43, 0x0a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61,
0x67, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e,
0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f,
0x75, 0x6e, 0x74, 0x22, 0x50, 0x0a, 0x1e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x64, 0x0a, 0x1f, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65,
0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f,
0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0xcc, 0x01, 0x0a, 0x20,
0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f,
0x6e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74,
0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x78,
0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61,
0x73, 0x74, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x75,
0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x75, 0x6e,
0x6e, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65,
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74,
0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01,
0x28, 0x05, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x65,
0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a,
0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x22, 0x34, 0x0a, 0x1c, 0x43, 0x72,
0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73,
0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f,
0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c,
0x22, 0xd9, 0x03, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
0x41, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
0x64, 0x41, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x41,
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65,
0x64, 0x41, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18,
0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12,
0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69,
0x73, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69,
0x73, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x41, 0x72, 0x63,
0x68, 0x69, 0x76, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x41,
0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c,
0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4b, 0x65,
0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x3b,
0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x45, 0x78, 0x65, 0x63,
0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x65,
0x70, 0x6f, 0x72, 0x74, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x09, 0x63,
0x72, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x6f, 0x6e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f,
0x77, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72,
0x74, 0x52, 0x09, 0x63, 0x72, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x0a,
0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72,
0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x6e, 0x0a, 0x20,
0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20,
0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0xbb, 0x0a, 0x0a,
0x17, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x46,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x40, 0x22, 0x2c, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x73, 0x12, 0xe9, 0x01, 0x0a, 0x15, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x21,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x95, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x8e, 0x01, 0x12, 0x3f, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73,
0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x2f, 0x7b, 0x6e, 0x61,
0x6d, 0x65, 0x7d, 0x5a, 0x4b, 0x12, 0x49, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62,
0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d,
0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x2f,
0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x7b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x7d,
0x12, 0xa8, 0x01, 0x0a, 0x17, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b,
0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57,
0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x1a,
0x3a, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b,
0x61, 0x74, 0x65, 0x73, 0x3a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0xc2, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x22, 0x66, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x60, 0x22, 0x4c, 0x2f, 0x61, 0x70,
0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f,
0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x77, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x75, 0x69, 0x64, 0x7d,
0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0xd3, 0x01, 0x0a, 0x13,
0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72,
0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x83, 0x01, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x7d, 0x12, 0x32, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f,
0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x5a, 0x47, 0x12, 0x45, 0x2f, 0x61, 0x70, 0x69,
0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x76,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x7d, 0x12, 0xb8, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x12, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72,
0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x12,
0x3b, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b,
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75,
0x69, 0x64, 0x7d, 0x2f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x69, 0x64, 0x7d, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x94, 0x01, 0x0a,
0x15, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62,
0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d,
0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x73, 0x12, 0xe9, 0x01, 0x0a, 0x15, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x57, 0x6f, 0x72,
0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x21, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f,
0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x95, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x8e,
0x01, 0x12, 0x3f, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72,
0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f,
0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
0x65, 0x7d, 0x5a, 0x4b, 0x12, 0x49, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f,
0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x2f, 0x7b,
0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x7b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x12,
0xa8, 0x01, 0x0a, 0x17, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66,
0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f,
0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x1a, 0x3a,
0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e,
0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c,
0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69,
0x64, 0x7d, 0x2f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (
@@ -1214,6 +1231,7 @@ var file_workflow_template_proto_goTypes = []interface{}{
(*WorkflowTemplate)(nil), // 12: api.WorkflowTemplate
(*GetWorkflowTemplateLabelsRequest)(nil), // 13: api.GetWorkflowTemplateLabelsRequest
(*KeyValue)(nil), // 14: api.KeyValue
(*Parameter)(nil), // 15: api.Parameter
}
var file_workflow_template_proto_depIdxs = []int32{
12, // 0: api.CreateWorkflowTemplateRequest.workflowTemplate:type_name -> api.WorkflowTemplate
@@ -1224,8 +1242,8 @@ var file_workflow_template_proto_depIdxs = []int32{
14, // 5: api.WorkflowTemplate.labels:type_name -> api.KeyValue
10, // 6: api.WorkflowTemplate.stats:type_name -> api.WorkflowExecutionStatisticReport
11, // 7: api.WorkflowTemplate.cronStats:type_name -> api.CronWorkflowStatisticsReport
0, // 8: api.WorkflowTemplateService.CreateWorkflowTemplate:input_type -> api.CreateWorkflowTemplateRequest
1, // 9: api.WorkflowTemplateService.UpdateWorkflowTemplateVersion:input_type -> api.UpdateWorkflowTemplateVersionRequest
15, // 8: api.WorkflowTemplate.parameters:type_name -> api.Parameter
0, // 9: api.WorkflowTemplateService.CreateWorkflowTemplate:input_type -> api.CreateWorkflowTemplateRequest
0, // 10: api.WorkflowTemplateService.CreateWorkflowTemplateVersion:input_type -> api.CreateWorkflowTemplateRequest
2, // 11: api.WorkflowTemplateService.GetWorkflowTemplate:input_type -> api.GetWorkflowTemplateRequest
4, // 12: api.WorkflowTemplateService.ListWorkflowTemplateVersions:input_type -> api.ListWorkflowTemplateVersionsRequest
@@ -1233,18 +1251,17 @@ var file_workflow_template_proto_depIdxs = []int32{
3, // 14: api.WorkflowTemplateService.CloneWorkflowTemplate:input_type -> api.CloneWorkflowTemplateRequest
8, // 15: api.WorkflowTemplateService.ArchiveWorkflowTemplate:input_type -> api.ArchiveWorkflowTemplateRequest
12, // 16: api.WorkflowTemplateService.CreateWorkflowTemplate:output_type -> api.WorkflowTemplate
12, // 17: api.WorkflowTemplateService.UpdateWorkflowTemplateVersion:output_type -> api.WorkflowTemplate
12, // 18: api.WorkflowTemplateService.CreateWorkflowTemplateVersion:output_type -> api.WorkflowTemplate
12, // 19: api.WorkflowTemplateService.GetWorkflowTemplate:output_type -> api.WorkflowTemplate
5, // 20: api.WorkflowTemplateService.ListWorkflowTemplateVersions:output_type -> api.ListWorkflowTemplateVersionsResponse
7, // 21: api.WorkflowTemplateService.ListWorkflowTemplates:output_type -> api.ListWorkflowTemplatesResponse
12, // 22: api.WorkflowTemplateService.CloneWorkflowTemplate:output_type -> api.WorkflowTemplate
9, // 23: api.WorkflowTemplateService.ArchiveWorkflowTemplate:output_type -> api.ArchiveWorkflowTemplateResponse
16, // [16:24] is the sub-list for method output_type
8, // [8:16] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
12, // 17: api.WorkflowTemplateService.CreateWorkflowTemplateVersion:output_type -> api.WorkflowTemplate
12, // 18: api.WorkflowTemplateService.GetWorkflowTemplate:output_type -> api.WorkflowTemplate
5, // 19: api.WorkflowTemplateService.ListWorkflowTemplateVersions:output_type -> api.ListWorkflowTemplateVersionsResponse
7, // 20: api.WorkflowTemplateService.ListWorkflowTemplates:output_type -> api.ListWorkflowTemplatesResponse
12, // 21: api.WorkflowTemplateService.CloneWorkflowTemplate:output_type -> api.WorkflowTemplate
9, // 22: api.WorkflowTemplateService.ArchiveWorkflowTemplate:output_type -> api.ArchiveWorkflowTemplateResponse
16, // [16:23] is the sub-list for method output_type
9, // [9:16] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension type_name
9, // [9:9] is the sub-list for extension extendee
0, // [0:9] is the sub-list for field type_name
}
func init() { file_workflow_template_proto_init() }
@@ -1253,6 +1270,7 @@ func file_workflow_template_proto_init() {
return
}
file_label_proto_init()
file_common_proto_init()
if !protoimpl.UnsafeEnabled {
file_workflow_template_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateWorkflowTemplateRequest); i {
@@ -1456,7 +1474,6 @@ const _ = grpc.SupportPackageIsVersion6
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type WorkflowTemplateServiceClient interface {
CreateWorkflowTemplate(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
UpdateWorkflowTemplateVersion(ctx context.Context, in *UpdateWorkflowTemplateVersionRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
CreateWorkflowTemplateVersion(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
GetWorkflowTemplate(ctx context.Context, in *GetWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
ListWorkflowTemplateVersions(ctx context.Context, in *ListWorkflowTemplateVersionsRequest, opts ...grpc.CallOption) (*ListWorkflowTemplateVersionsResponse, error)
@@ -1482,15 +1499,6 @@ func (c *workflowTemplateServiceClient) CreateWorkflowTemplate(ctx context.Conte
return out, nil
}
func (c *workflowTemplateServiceClient) UpdateWorkflowTemplateVersion(ctx context.Context, in *UpdateWorkflowTemplateVersionRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error) {
out := new(WorkflowTemplate)
err := c.cc.Invoke(ctx, "/api.WorkflowTemplateService/UpdateWorkflowTemplateVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workflowTemplateServiceClient) CreateWorkflowTemplateVersion(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error) {
out := new(WorkflowTemplate)
err := c.cc.Invoke(ctx, "/api.WorkflowTemplateService/CreateWorkflowTemplateVersion", in, out, opts...)
@@ -1548,7 +1556,6 @@ func (c *workflowTemplateServiceClient) ArchiveWorkflowTemplate(ctx context.Cont
// WorkflowTemplateServiceServer is the server API for WorkflowTemplateService service.
type WorkflowTemplateServiceServer interface {
CreateWorkflowTemplate(context.Context, *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error)
UpdateWorkflowTemplateVersion(context.Context, *UpdateWorkflowTemplateVersionRequest) (*WorkflowTemplate, error)
CreateWorkflowTemplateVersion(context.Context, *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error)
GetWorkflowTemplate(context.Context, *GetWorkflowTemplateRequest) (*WorkflowTemplate, error)
ListWorkflowTemplateVersions(context.Context, *ListWorkflowTemplateVersionsRequest) (*ListWorkflowTemplateVersionsResponse, error)
@@ -1564,9 +1571,6 @@ type UnimplementedWorkflowTemplateServiceServer struct {
func (*UnimplementedWorkflowTemplateServiceServer) CreateWorkflowTemplate(context.Context, *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateWorkflowTemplate not implemented")
}
func (*UnimplementedWorkflowTemplateServiceServer) UpdateWorkflowTemplateVersion(context.Context, *UpdateWorkflowTemplateVersionRequest) (*WorkflowTemplate, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkflowTemplateVersion not implemented")
}
func (*UnimplementedWorkflowTemplateServiceServer) CreateWorkflowTemplateVersion(context.Context, *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateWorkflowTemplateVersion not implemented")
}
@@ -1608,24 +1612,6 @@ func _WorkflowTemplateService_CreateWorkflowTemplate_Handler(srv interface{}, ct
return interceptor(ctx, in, info, handler)
}
func _WorkflowTemplateService_UpdateWorkflowTemplateVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateWorkflowTemplateVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkflowTemplateServiceServer).UpdateWorkflowTemplateVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.WorkflowTemplateService/UpdateWorkflowTemplateVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkflowTemplateServiceServer).UpdateWorkflowTemplateVersion(ctx, req.(*UpdateWorkflowTemplateVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkflowTemplateService_CreateWorkflowTemplateVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateWorkflowTemplateRequest)
if err := dec(in); err != nil {
@@ -1742,10 +1728,6 @@ var _WorkflowTemplateService_serviceDesc = grpc.ServiceDesc{
MethodName: "CreateWorkflowTemplate",
Handler: _WorkflowTemplateService_CreateWorkflowTemplate_Handler,
},
{
MethodName: "UpdateWorkflowTemplateVersion",
Handler: _WorkflowTemplateService_UpdateWorkflowTemplateVersion_Handler,
},
{
MethodName: "CreateWorkflowTemplateVersion",
Handler: _WorkflowTemplateService_CreateWorkflowTemplateVersion_Handler,

View File

@@ -101,120 +101,6 @@ func local_request_WorkflowTemplateService_CreateWorkflowTemplate_0(ctx context.
}
func request_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateWorkflowTemplateVersionRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkflowTemplate); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
val, ok = pathParams["workflowTemplate.uid"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflowTemplate.uid")
}
err = runtime.PopulateFieldFromPath(&protoReq, "workflowTemplate.uid", val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflowTemplate.uid", err)
}
val, ok = pathParams["workflowTemplate.version"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflowTemplate.version")
}
err = runtime.PopulateFieldFromPath(&protoReq, "workflowTemplate.version", val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflowTemplate.version", err)
}
msg, err := client.UpdateWorkflowTemplateVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowTemplateServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateWorkflowTemplateVersionRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkflowTemplate); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
val, ok = pathParams["workflowTemplate.uid"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflowTemplate.uid")
}
err = runtime.PopulateFieldFromPath(&protoReq, "workflowTemplate.uid", val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflowTemplate.uid", err)
}
val, ok = pathParams["workflowTemplate.version"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflowTemplate.version")
}
err = runtime.PopulateFieldFromPath(&protoReq, "workflowTemplate.version", val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflowTemplate.version", err)
}
msg, err := server.UpdateWorkflowTemplateVersion(ctx, &protoReq)
return msg, metadata, err
}
func request_WorkflowTemplateService_CreateWorkflowTemplateVersion_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateWorkflowTemplateRequest
var metadata runtime.ServerMetadata
@@ -975,26 +861,6 @@ func RegisterWorkflowTemplateServiceHandlerServer(ctx context.Context, mux *runt
})
mux.Handle("PUT", pattern_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_WorkflowTemplateService_CreateWorkflowTemplateVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1216,26 +1082,6 @@ func RegisterWorkflowTemplateServiceHandlerClient(ctx context.Context, mux *runt
})
mux.Handle("PUT", pattern_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_WorkflowTemplateService_CreateWorkflowTemplateVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1402,8 +1248,6 @@ func RegisterWorkflowTemplateServiceHandlerClient(ctx context.Context, mux *runt
var (
pattern_WorkflowTemplateService_CreateWorkflowTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflow_templates"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"apis", "v1beta1", "namespace", "workflow_templates", "workflowTemplate.uid", "versions", "workflowTemplate.version"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowTemplateService_CreateWorkflowTemplateVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflow_templates", "workflowTemplate.uid", "versions"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowTemplateService_GetWorkflowTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "workflow_templates", "uid"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -1424,8 +1268,6 @@ var (
var (
forward_WorkflowTemplateService_CreateWorkflowTemplate_0 = runtime.ForwardResponseMessage
forward_WorkflowTemplateService_UpdateWorkflowTemplateVersion_0 = runtime.ForwardResponseMessage
forward_WorkflowTemplateService_CreateWorkflowTemplateVersion_0 = runtime.ForwardResponseMessage
forward_WorkflowTemplateService_GetWorkflowTemplate_0 = runtime.ForwardResponseMessage

View File

@@ -4,6 +4,7 @@ package api;
import "google/api/annotations.proto";
import "label.proto";
import "common.proto";
service WorkflowTemplateService {
rpc CreateWorkflowTemplate (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
@@ -13,13 +14,6 @@ service WorkflowTemplateService {
};
}
rpc UpdateWorkflowTemplateVersion (UpdateWorkflowTemplateVersionRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
put: "/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions/{workflowTemplate.version}"
body: "workflowTemplate"
};
}
rpc CreateWorkflowTemplateVersion (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
post: "/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions"
@@ -101,6 +95,8 @@ message ListWorkflowTemplatesRequest {
string namespace = 1;
int32 pageSize = 2;
int32 page = 3;
string labels = 4;
}
message ListWorkflowTemplatesResponse {
@@ -135,18 +131,19 @@ message CronWorkflowStatisticsReport {
message WorkflowTemplate {
string createdAt = 1;
string uid = 2;
string name = 3;
int64 version = 4;
int64 versions = 5;
string manifest = 6;
bool isLatest = 7;
bool isArchived = 8;
repeated KeyValue labels = 9;
WorkflowExecutionStatisticReport stats = 10;
CronWorkflowStatisticsReport cronStats = 11;
string modifiedAt = 2;
string uid = 3;
string name = 4;
int64 version = 5;
int64 versions = 6;
string manifest = 7;
bool isLatest = 8;
bool isArchived = 9;
repeated KeyValue labels = 10;
WorkflowExecutionStatisticReport stats = 11;
CronWorkflowStatisticsReport cronStats = 12;
repeated Parameter parameters = 13;
}
message GetWorkflowTemplateLabelsRequest {

View File

@@ -45,6 +45,7 @@ type WorkspaceTemplate struct {
WorkflowTemplate *WorkflowTemplate `protobuf:"bytes,7,opt,name=workflowTemplate,proto3" json:"workflowTemplate,omitempty"`
Labels []*KeyValue `protobuf:"bytes,8,rep,name=labels,proto3" json:"labels,omitempty"`
IsArchived bool `protobuf:"varint,9,opt,name=isArchived,proto3" json:"isArchived,omitempty"`
Description string `protobuf:"bytes,10,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *WorkspaceTemplate) Reset() {
@@ -142,6 +143,13 @@ func (x *WorkspaceTemplate) GetIsArchived() bool {
return false
}
func (x *WorkspaceTemplate) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
type GenerateWorkspaceTemplateWorkflowTemplateRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -704,7 +712,7 @@ var file_workspace_template_proto_rawDesc = []byte{
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x22, 0xb3, 0x02, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65,
0x22, 0xd5, 0x02, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07,
@@ -723,158 +731,161 @@ var file_workspace_template_proto_rawDesc = []byte{
0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06,
0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x41, 0x72, 0x63, 0x68,
0x69, 0x76, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x41, 0x72,
0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x22, 0xa8, 0x01, 0x0a, 0x30, 0x47, 0x65, 0x6e, 0x65, 0x72,
0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e,
0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x44, 0x0a, 0x11, 0x77,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72,
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x11,
0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x22, 0x84, 0x01, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b,
0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x12, 0x44, 0x0a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x1e, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e,
0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x44, 0x0a, 0x11, 0x77,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72,
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x11,
0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x22, 0x67, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10,
0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64,
0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x51, 0x0a, 0x1f, 0x41, 0x72,
0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65,
0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73,
0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x30, 0x47, 0x65, 0x6e,
0x65, 0x72, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a,
0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x6d, 0x0a,
0x1d, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c,
0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0xc8, 0x01, 0x0a,
0x1e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73,
0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x12, 0x0a,
0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67,
0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c,
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74,
0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x56, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x57,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x44, 0x0a,
0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f,
0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x1e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a,
0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x44, 0x0a,
0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x22, 0x67, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75,
0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20,
0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x51, 0x0a, 0x1f,
0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a,
0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22,
0x85, 0x01, 0x0a, 0x25, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12,
0x46, 0x0a, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x52, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x32, 0xce, 0x09, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6b,
0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0xdb, 0x01, 0x0a, 0x29, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x12, 0x35, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x22, 0x60, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5a, 0x22, 0x45, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f,
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x77, 0x6f,
0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x3a,
0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x12, 0xa0, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72,
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x23,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73,
0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x48, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x42, 0x22, 0x2d, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74,
0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x73, 0x3a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0xa6, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f,
0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72,
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x4e,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x48, 0x1a, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x3a, 0x11, 0x77, 0x6f, 0x72,
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x9d,
0x01, 0x0a, 0x18, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x24, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x3d, 0x1a, 0x3b, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72,
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73,
0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x12, 0x8d,
0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65,
0x6d, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1a,
0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0xc8,
0x01, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73,
0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x12, 0x77, 0x6f, 0x72,
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12,
0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70,
0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01,
0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74,
0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74,
0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x56, 0x0a, 0x24, 0x4c, 0x69, 0x73,
0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x73,
0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x12, 0x98,
0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x61, 0x70, 0x69,
0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f,
0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0xbc, 0x01, 0x0a, 0x1d, 0x4c, 0x69,
0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x12, 0x3c, 0x2f, 0x61, 0x70, 0x69,
0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69,
0x64, 0x22, 0x85, 0x01, 0x0a, 0x25, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x12, 0x46, 0x0a, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x32, 0xce, 0x09, 0x0a, 0x18, 0x57, 0x6f,
0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xdb, 0x01, 0x0a, 0x29, 0x47, 0x65, 0x6e, 0x65, 0x72,
0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x12, 0x35, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72,
0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61,
0x74, 0x65, 0x22, 0x60, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5a, 0x22, 0x45, 0x2f, 0x61, 0x70, 0x69,
0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f,
0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f,
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x3a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x12, 0xa0, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72,
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b,
0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x48, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x42, 0x22, 0x2d, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62,
0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d,
0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x73, 0x3a, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0xa6, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x22, 0x4e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x48, 0x1a, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f,
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x65,
0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x3a, 0x11, 0x77,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x12, 0x9d, 0x01, 0x0a, 0x18, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b,
0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x24, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73,
0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x3d, 0x1a, 0x3b, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74,
0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74,
0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65,
0x12, 0x8d, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x61, 0x74, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x61, 0x70,
0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d,
0x12, 0x98, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54,
0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x61,
0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0xbc, 0x01, 0x0a, 0x1d,
0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d,
0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c,
0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x65, 0x6d, 0x70,
0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x12, 0x3c, 0x2f, 0x61,
0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63,
0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x75, 0x69, 0x64,
0x7d, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (

View File

@@ -69,6 +69,7 @@ message WorkspaceTemplate {
WorkflowTemplate workflowTemplate = 7;
repeated KeyValue labels = 8;
bool isArchived = 9;
string description = 10;
}
message GenerateWorkspaceTemplateWorkflowTemplateRequest {

17
cmd/README.md Normal file
View File

@@ -0,0 +1,17 @@
# Helper scripts
## gen-release-md.go
Generates markdown for releases.
Usage:
```bash
go run cmd/gen-release-md/gen-release-md.go -v=0.10.0 -u=[github-username] > /tmp/release.md
```
## goose.go
Supports both Go and SQL migrations.
```bash
go run cmd/goose/goose up # run up migrations
go run cmd/goose/goose down # run down migrations
```

View File

@@ -0,0 +1,251 @@
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"net/http"
"sort"
"strings"
)
type user struct {
Login string `json:"login"`
URL string `json:"html_url"`
AvatarURL string `json:"avatar_url"`
ContributionsCount int
}
type label struct {
Name string `json:"name"`
}
type pullRequest struct {
URL string `json:"url"`
}
type issue struct {
Number int `json:"number"`
URL string `json:"html_url"`
Title string `json:"title"`
User user `json:"user"`
PullRequest *pullRequest `json:"pull_request"`
Labels []label `json:"labels"`
}
type milestone struct {
Number int `json:"number"`
Title string `json:"title"`
}
const (
apiPrefix = "https://api.github.com/repos/"
)
var releaseTemplate = `# Documentation
See https://docs.onepanel.ai
# CLI Installation
## Linux
` + "```" + `
# Download the binary
curl -sLO https://github.com/onepanelio/core/releases/download/v%s/opctl-linux-amd64
# Make binary executable
chmod +x opctl-linux-amd64
# Move binary to path
mv ./opctl-linux-amd64 /usr/local/bin/opctl
# Test installation
opctl version
` + "```" + `
## macOS
` + "```" + `
# Download the binary
curl -sLO https://github.com/onepanelio/core/releases/download/v%s/opctl-macos-amd64
# Make binary executable
chmod +x opctl-macos-amd64
# Move binary to path
mv ./opctl-macos-amd64 /usr/local/bin/opctl
# Test installation
opctl version
` + "```" + `
## Windows
Download the [attached executable](https://github.com/onepanelio/core/releases/download/v%s/opctl-windows-amd64.exe), rename it to "opctl" and move it to a folder that is in your PATH environment variable.
`
var repositories = []string{
"onepanelio/core",
"onepanelio/core-ui",
"onepanelio/cli",
"onepanelio/manifests",
"onepanelio/core-docs",
}
func getPrefixSection(prefix string) (section string) {
switch prefix {
case "feat":
fallthrough
case "fix":
fallthrough
case "docs":
section = prefix
default:
section = "other"
}
return
}
// Parse issues, pulling only PRs and categorize them based on labels
// Print everything as MD that can be copied into release notes
func printMarkDown(issues []*issue, version *string) {
contributorsMap := make(map[string]user, 0)
sections := make(map[string]string, 0)
for _, iss := range issues {
if iss.PullRequest == nil {
continue
}
parts := strings.Split(iss.Title, ":")
if len(parts) > 0 {
if user, ok := contributorsMap[iss.User.Login]; ok {
user.ContributionsCount++
contributorsMap[iss.User.Login] = user
} else {
iss.User.ContributionsCount = 1
contributorsMap[iss.User.Login] = iss.User
}
sections[getPrefixSection(parts[0])] += fmt.Sprintf("- %s ([#%d](%s))\n", iss.Title, iss.Number, iss.URL)
}
}
releaseTemplate := fmt.Sprintf(releaseTemplate, *version, *version, *version)
fmt.Println(releaseTemplate)
fmt.Println("# Changelog")
if sections["feat"] != "" {
fmt.Println("## Features")
fmt.Println(sections["feat"])
}
if sections["fix"] != "" {
fmt.Println("## Fixes")
fmt.Println(sections["fix"])
}
if sections["docs"] != "" {
fmt.Println("## Docs")
fmt.Println(sections["docs"])
}
if sections["other"] != "" {
fmt.Println("## Other")
fmt.Println(sections["other"])
}
fmt.Println("# Contributors")
contributors := make([]user, 0)
for _, contributor := range contributorsMap {
contributors = append(contributors, contributor)
}
sort.Slice(contributors, func(i, j int) bool { return contributors[i].ContributionsCount > contributors[j].ContributionsCount })
for _, user := range contributors {
fmt.Println(fmt.Sprintf("- <a href=\"%s\"><img src=\"%s\" width=\"12\"/> <strong>%s</strong></a> %s", user.URL, user.AvatarURL, user.Login, user.Login))
}
}
func httpGet(url string, username, token *string) (*http.Response, error) {
client := &http.Client{}
req, err := http.NewRequest(http.MethodGet, url, nil)
if username != nil {
req.SetBasicAuth(*username, *token)
}
res, err := client.Do(req)
if err != nil {
return nil, err
}
return res, nil
}
// Get milestone by title
func getMilestone(repository string, version, username, token *string) (*milestone, error) {
url := fmt.Sprintf("%s%s/milestones", apiPrefix, repository)
res, err := httpGet(url, username, token)
if err != nil {
return nil, err
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
return nil, errors.New("API rate limit exceeded")
}
milestones := make([]*milestone, 0)
if err = json.NewDecoder(res.Body).Decode(&milestones); err != nil {
return nil, err
}
for _, milestone := range milestones {
if milestone.Title == "v"+*version {
return milestone, nil
}
}
return nil, errors.New("milestone not found")
}
// Get issues from repository
func getIssues(repository string, milestone *milestone, username, token *string) ([]*issue, error) {
url := fmt.Sprintf("%s%s/issues?state=closed&direction=asc&milestone=%d", apiPrefix, repository, milestone.Number)
res, err := httpGet(url, username, token)
if err != nil {
return nil, err
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
return nil, errors.New("API rate limit exceeded")
}
issues := make([]*issue, 0)
if err = json.NewDecoder(res.Body).Decode(&issues); err != nil {
return nil, err
}
return issues, nil
}
func main() {
version := flag.String("v", "1.0.0", "Version of release, example: -v=1.0.0")
username := flag.String("u", "", "GitHub username for request, example: -u=octocat")
token := flag.String("t", "", "GitHub token for request, example: -t=<token>")
flag.Parse()
issues := make([]*issue, 0)
for _, repository := range repositories {
mil, err := getMilestone(repository, version, username, token)
if err != nil {
fmt.Printf(err.Error())
return
}
iss, err := getIssues(repository, mil, username, token)
if err != nil {
return
}
issues = append(issues, iss...)
}
printMarkDown(issues, version)
}

62
cmd/goose/goose.go Normal file
View File

@@ -0,0 +1,62 @@
// This is custom goose binary to support .go migration files in ./db dir
package main
import (
"flag"
"github.com/jmoiron/sqlx"
migrations "github.com/onepanelio/core/db/go"
v1 "github.com/onepanelio/core/pkg"
"log"
"os"
"path/filepath"
"github.com/pressly/goose"
)
var (
flags = flag.NewFlagSet("goose", flag.ExitOnError)
dir = flags.String("dir", ".", "directory with migration files")
)
func main() {
flags.Parse(os.Args[1:])
args := flags.Args()
if len(args) < 1 {
flags.Usage()
return
}
kubeConfig := v1.NewConfig()
client, err := v1.NewClient(kubeConfig, nil, nil)
if err != nil {
log.Fatalf("Failed to connect to Kubernetes cluster: %v", err)
}
config, err := client.GetSystemConfig()
if err != nil {
log.Fatalf("Failed to get system config: %v", err)
}
dbDriverName, dbDataSourceName := config.DatabaseConnection()
db := sqlx.MustConnect(dbDriverName, dbDataSourceName)
defer db.Close()
command := args[0]
arguments := []string{}
if len(args) > 2 {
arguments = append(arguments, args[2:]...)
}
goose.SetTableName("goose_db_version")
if err := goose.Run(command, db.DB, filepath.Join(*dir, "sql"), arguments...); err != nil {
log.Fatalf("Failed to run database sql migrations: %v %v", command, err)
}
goose.SetTableName("goose_db_go_version")
migrations.Initialize()
if err := goose.Run(command, db.DB, filepath.Join(*dir, "go"), arguments...); err != nil {
log.Fatalf("Failed to run database go migrations: %v %v", command, err)
}
}

View File

@@ -0,0 +1,137 @@
// Package migration is for carrying out migrations against the database.
// To support Onepanel Core operations.
package migration
import (
"database/sql"
v1 "github.com/onepanelio/core/pkg"
uid2 "github.com/onepanelio/core/pkg/util/uid"
"github.com/pressly/goose"
"log"
)
const jupyterWorkspaceTemplate = `# Docker containers that are part of the Workspace
containers:
- name: jupyterlab-tensorflow
image: jupyter/tensorflow-notebook
command: [start.sh, jupyter]
env:
- name: tornado
value: "{ 'headers': { 'Content-Security-Policy': \"frame-ancestors * 'self'\" } }"
args:
- lab
- --LabApp.token=''
- --LabApp.allow_remote_access=True
- --LabApp.allow_origin="*"
- --LabApp.disable_check_xsrf=True
- --LabApp.trust_xheaders=True
- --LabApp.tornado_settings=$(tornado)
- --notebook-dir='/data'
ports:
- containerPort: 8888
name: jupyterlab
# Volumes to be mounted in this container
# Onepanel will automatically create these volumes and mount them to the container
volumeMounts:
- name: data
mountPath: /data
# Ports that need to be exposed
ports:
- name: jupyterlab
port: 80
protocol: TCP
targetPort: 8888
# Routes that will map to ports
routes:
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 80
# DAG Workflow to be executed once a Workspace action completes
# postExecutionWorkflow:
# entrypoint: main
# templates:
# - name: main
# dag:
# tasks:
# - name: slack-notify
# template: slack-notify
# - name: slack-notify
# container:
# image: technosophos/slack-notify
# args:
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
# command:
# - sh
# - -c
`
const jupyterLabTemplateName = "JupyterLab"
func initialize20200525160514() {
if _, ok := initializedMigrations[20200525160514]; !ok {
goose.AddMigration(Up20200525160514, Down20200525160514)
initializedMigrations[20200525160514] = true
}
}
func Up20200525160514(tx *sql.Tx) error {
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200525160514]; ok {
return nil
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
workspaceTemplate := &v1.WorkspaceTemplate{
Name: jupyterLabTemplateName,
Manifest: jupyterWorkspaceTemplate,
}
for _, namespace := range namespaces {
if _, err := client.CreateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
return err
}
}
return nil
}
func Down20200525160514(tx *sql.Tx) error {
client, err := getClient()
if err != nil {
return err
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
uid, err := uid2.GenerateUID(jupyterLabTemplateName, 30)
if err != nil {
return err
}
for _, namespace := range namespaces {
if _, err := client.ArchiveWorkspaceTemplate(namespace.Name, uid); err != nil {
log.Fatalf("error %v", err.Error())
}
}
return nil
}

View File

@@ -0,0 +1,189 @@
package migration
import (
"database/sql"
v1 "github.com/onepanelio/core/pkg"
uid2 "github.com/onepanelio/core/pkg/util/uid"
"github.com/pressly/goose"
"log"
)
const cvatWorkspaceTemplate = `# Docker containers that are part of the Workspace
containers:
- name: cvat-db
image: postgres:10-alpine
env:
- name: POSTGRES_USER
value: root
- name: POSTGRES_DB
value: cvat
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
- name: PGDATA
value: /var/lib/psql/data
ports:
- containerPort: 5432
name: tcp
volumeMounts:
- name: db
mountPath: /var/lib/psql
- name: cvat-redis
image: redis:4.0-alpine
ports:
- containerPort: 6379
name: tcp
- name: cvat
image: onepanel/cvat:v0.7.0
env:
- name: DJANGO_MODWSGI_EXTRA_ARGS
value: ""
- name: ALLOWED_HOSTS
value: '*'
- name: CVAT_REDIS_HOST
value: localhost
- name: CVAT_POSTGRES_HOST
value: localhost
- name: CVAT_SHARE_URL
value: /home/django/data
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: data
mountPath: /home/django/data
- name: keys
mountPath: /home/django/keys
- name: logs
mountPath: /home/django/logs
- name: models
mountPath: /home/django/models
- name: cvat-ui
image: onepanel/cvat-ui:v0.7.0
ports:
- containerPort: 80
name: http
ports:
- name: cvat-ui
port: 80
protocol: TCP
targetPort: 80
- name: cvat
port: 8080
protocol: TCP
targetPort: 8080
routes:
- match:
- uri:
regex: /api/.*|/git/.*|/tensorflow/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
- queryParams:
id:
regex: \d+.*
route:
- destination:
port:
number: 8080
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 80
# DAG Workflow to be executed once a Workspace action completes
# postExecutionWorkflow:
# entrypoint: main
# templates:
# - name: main
# dag:
# tasks:
# - name: slack-notify
# template: slack-notify
# - name: slack-notify
# container:
# image: technosophos/slack-notify
# args:
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
# command:
# - sh
# - -c
`
const cvatTemplateName = "CVAT"
func initialize20200528140124() {
if _, ok := initializedMigrations[20200528140124]; !ok {
goose.AddMigration(Up20200528140124, Down20200528140124)
initializedMigrations[20200528140124] = true
}
}
// Up20200528140124 will insert the cvatTemplate to each user.
// Each user is determined by onepanel enabled namespaces.
// Any errors reported are logged as fatal.
func Up20200528140124(tx *sql.Tx) error {
// This code is executed when the migration is applied.
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200528140124]; ok {
return nil
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
workspaceTemplate := &v1.WorkspaceTemplate{
Name: cvatTemplateName,
Manifest: cvatWorkspaceTemplate,
}
for _, namespace := range namespaces {
if _, err := client.CreateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
return err
}
}
return nil
}
// Down20200528140124 will attempt to remove cvatTemplate from each user.
// Each user is determined by onepanel enabled namespaces.
// DB entries are archived, K8S components are deleted.
// Active workspaces with that template are terminated.
// Any errors reported are logged as fatal.
func Down20200528140124(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
client, err := getClient()
if err != nil {
return err
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
if err != nil {
return err
}
for _, namespace := range namespaces {
if _, err := client.ArchiveWorkspaceTemplate(namespace.Name, uid); err != nil {
log.Fatalf("error %v", err.Error())
}
}
return nil
}

View File

@@ -0,0 +1,164 @@
package migration
import (
"database/sql"
"log"
v1 "github.com/onepanelio/core/pkg"
uid2 "github.com/onepanelio/core/pkg/util/uid"
"github.com/pressly/goose"
)
const pytorchMnistWorkflowTemplate = `entrypoint: main
arguments:
parameters:
- name: source
value: https://github.com/onepanelio/pytorch-examples.git
- name: command
value: "python mnist/main.py --epochs=1"
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 2Gi
- metadata:
name: output
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 2Gi
templates:
- name: main
dag:
tasks:
- name: train-model
template: pytorch
# Uncomment section below to send metrics to Slack
# - name: notify-in-slack
# dependencies: [train-model]
# template: slack-notify-success
# arguments:
# parameters:
# - name: status
# value: "{{tasks.train-model.status}}"
# artifacts:
# - name: metrics
# from: "{{tasks.train-model.outputs.artifacts.sys-metrics}}"
- name: pytorch
inputs:
artifacts:
- name: src
path: /mnt/src
git:
repo: "{{workflow.parameters.source}}"
outputs:
artifacts:
- name: model
path: /mnt/output
optional: true
archive:
none: {}
container:
image: pytorch/pytorch:latest
command: [sh,-c]
args: ["{{workflow.parameters.command}}"]
workingDir: /mnt/src
volumeMounts:
- name: data
mountPath: /mnt/data
- name: output
mountPath: /mnt/output
- name: slack-notify-success
container:
image: technosophos/slack-notify
command: [sh,-c]
args: ['SLACK_USERNAME=Worker SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify']
inputs:
parameters:
- name: status
artifacts:
- name: metrics
path: /tmp/metrics.json
optional: true
`
const pytorchMnistWorkflowTemplateName = "PyTorch Training"
func initialize20200605090509() {
if _, ok := initializedMigrations[20200605090509]; !ok {
goose.AddMigration(Up20200605090509, Down20200605090509)
initializedMigrations[20200605090509] = true
}
}
// Up20200605090509 will insert a Pytorch workflow template to each user.
// Each user is determined by onepanel enabled namespaces.
// Any errors reported are logged as fatal.
func Up20200605090509(tx *sql.Tx) error {
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200605090509]; ok {
return nil
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
workflowTemplate := &v1.WorkflowTemplate{
Name: pytorchMnistWorkflowTemplateName,
Manifest: pytorchMnistWorkflowTemplate,
}
for _, namespace := range namespaces {
if _, err := client.CreateWorkflowTemplate(namespace.Name, workflowTemplate); err != nil {
return err
}
}
return nil
}
// Down20200605090509 will attempt to remove Pytorch workflow from each user.
// Each user is determined by onepanel enabled namespaces.
// DB entries are archived, K8S components are deleted.
// Active workflows with that template are terminated.
// Any errors reported are logged as fatal.
func Down20200605090509(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
client, err := getClient()
if err != nil {
return err
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
uid, err := uid2.GenerateUID(pytorchMnistWorkflowTemplateName, 30)
if err != nil {
return err
}
for _, namespace := range namespaces {
if _, err := client.ArchiveWorkflowTemplate(namespace.Name, uid); err != nil {
log.Fatalf("error %v", err.Error())
}
}
return nil
}

View File

@@ -0,0 +1,163 @@
package migration
import (
"database/sql"
"log"
v1 "github.com/onepanelio/core/pkg"
uid2 "github.com/onepanelio/core/pkg/util/uid"
"github.com/pressly/goose"
)
const tensorflowWorkflowTemplate = `entrypoint: main
arguments:
parameters:
- name: source
value: https://github.com/onepanelio/tensorflow-examples.git
- name: command
value: "python mnist/main.py --epochs=5"
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 2Gi
- metadata:
name: output
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 2Gi
templates:
- name: main
dag:
tasks:
- name: train-model
template: pytorch
# Uncomment section below to send metrics to Slack
# - name: notify-in-slack
# dependencies: [train-model]
# template: slack-notify-success
# arguments:
# parameters:
# - name: status
# value: "{{tasks.train-model.status}}"
# artifacts:
# - name: metrics
# from: "{{tasks.train-model.outputs.artifacts.sys-metrics}}"
- name: pytorch
inputs:
artifacts:
- name: src
path: /mnt/src
git:
repo: "{{workflow.parameters.source}}"
outputs:
artifacts:
- name: model
path: /mnt/output
optional: true
archive:
none: {}
container:
image: tensorflow/tensorflow:latest
command: [sh,-c]
args: ["{{workflow.parameters.command}}"]
workingDir: /mnt/src
volumeMounts:
- name: data
mountPath: /mnt/data
- name: output
mountPath: /mnt/output
- name: slack-notify-success
container:
image: technosophos/slack-notify
command: [sh,-c]
args: ['SLACK_USERNAME=Worker SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify']
inputs:
parameters:
- name: status
artifacts:
- name: metrics
path: /tmp/metrics.json
optional: true
`
const tensorflowWorkflowTemplateName = "TensorFlow Training"
func initialize20200605090535() {
if _, ok := initializedMigrations[20200605090535]; !ok {
goose.AddMigration(Up20200605090535, Down20200605090535)
initializedMigrations[20200605090535] = true
}
}
// Up20200605090535 will insert a tensorflow workflow template to each user.
// Each user is determined by onepanel enabled namespaces.
// Any errors reported are logged as fatal.
func Up20200605090535(tx *sql.Tx) error {
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200605090535]; ok {
return nil
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
workflowTemplate := &v1.WorkflowTemplate{
Name: tensorflowWorkflowTemplateName,
Manifest: tensorflowWorkflowTemplate,
}
for _, namespace := range namespaces {
if _, err := client.CreateWorkflowTemplate(namespace.Name, workflowTemplate); err != nil {
return err
}
}
return nil
}
// Down20200605090535 will attempt to remove tensorflow workflow from each user.
// Each user is determined by onepanel enabled namespaces.
// DB entries are archived, K8S components are deleted.
// Active workflows with that template are terminated.
// Any errors reported are logged as fatal.
func Down20200605090535(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
client, err := getClient()
if err != nil {
return err
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
uid, err := uid2.GenerateUID(tensorflowWorkflowTemplateName, 30)
if err != nil {
return err
}
for _, namespace := range namespaces {
if _, err := client.ArchiveWorkflowTemplate(namespace.Name, uid); err != nil {
log.Fatalf("error %v", err.Error())
}
}
return nil
}

View File

@@ -0,0 +1,174 @@
package migration
import (
"database/sql"
v1 "github.com/onepanelio/core/pkg"
uid2 "github.com/onepanelio/core/pkg/util/uid"
"github.com/pressly/goose"
)
const cvatWorkspaceTemplate2 = `# Docker containers that are part of the Workspace
containers:
- name: cvat-db
image: postgres:10-alpine
env:
- name: POSTGRES_USER
value: root
- name: POSTGRES_DB
value: cvat
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
- name: PGDATA
value: /var/lib/psql/data
ports:
- containerPort: 5432
name: tcp
volumeMounts:
- name: db
mountPath: /var/lib/psql
- name: cvat-redis
image: redis:4.0-alpine
ports:
- containerPort: 6379
name: tcp
- name: cvat
image: onepanel/cvat:v0.7.6
env:
- name: DJANGO_MODWSGI_EXTRA_ARGS
value: ""
- name: ALLOWED_HOSTS
value: '*'
- name: CVAT_REDIS_HOST
value: localhost
- name: CVAT_POSTGRES_HOST
value: localhost
- name: CVAT_SHARE_URL
value: /home/django/data
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: data
mountPath: /home/django/data
- name: keys
mountPath: /home/django/keys
- name: logs
mountPath: /home/django/logs
- name: models
mountPath: /home/django/models
- name: share
mountPath: /home/django/share
- name: cvat-ui
image: onepanel/cvat-ui:v0.7.5
ports:
- containerPort: 80
name: http
- name: filesyncer
image: onepanel/filesyncer:v0.0.4
command: ['python3', 'main.py']
volumeMounts:
- name: share
mountPath: /mnt/share
ports:
- name: cvat-ui
port: 80
protocol: TCP
targetPort: 80
- name: cvat
port: 8080
protocol: TCP
targetPort: 8080
routes:
- match:
- uri:
regex: /api/.*|/git/.*|/tensorflow/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
- queryParams:
id:
regex: \d+.*
route:
- destination:
port:
number: 8080
timeout: 600s
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 80
timeout: 600s
# DAG Workflow to be executed once a Workspace action completes (optional)
# Uncomment the lines below if you want to send Slack notifications
#postExecutionWorkflow:
# entrypoint: main
# templates:
# - name: main
# dag:
# tasks:
# - name: slack-notify
# template: slack-notify
# - name: slack-notify
# container:
# image: technosophos/slack-notify
# args:
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
# command:
# - sh
# - -c
`
func initialize20200626113635() {
if _, ok := initializedMigrations[20200626113635]; !ok {
goose.AddMigration(Up20200626113635, Down20200626113635)
initializedMigrations[20200626113635] = true
}
}
// Up20200626113635 updates the CVAT template to a new version.
func Up20200626113635(tx *sql.Tx) error {
// This code is executed when the migration is applied.
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200626113635]; ok {
return nil
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
if err != nil {
return err
}
workspaceTemplate := &v1.WorkspaceTemplate{
UID: uid,
Name: cvatTemplateName,
Manifest: cvatWorkspaceTemplate2,
}
for _, namespace := range namespaces {
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
return err
}
}
return nil
}
// Down20200626113635 removes the CVAT template update
func Down20200626113635(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return nil
}

View File

@@ -0,0 +1,176 @@
package migration
import (
"database/sql"
v1 "github.com/onepanelio/core/pkg"
uid2 "github.com/onepanelio/core/pkg/util/uid"
"github.com/pressly/goose"
)
const cvatWorkspaceTemplate3 = `# Docker containers that are part of the Workspace
containers:
- name: cvat-db
image: postgres:10-alpine
env:
- name: POSTGRES_USER
value: root
- name: POSTGRES_DB
value: cvat
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
- name: PGDATA
value: /var/lib/psql/data
ports:
- containerPort: 5432
name: tcp
volumeMounts:
- name: db
mountPath: /var/lib/psql
- name: cvat-redis
image: redis:4.0-alpine
ports:
- containerPort: 6379
name: tcp
- name: cvat
image: onepanel/cvat:v0.7.10-stable
env:
- name: DJANGO_MODWSGI_EXTRA_ARGS
value: ""
- name: ALLOWED_HOSTS
value: '*'
- name: CVAT_REDIS_HOST
value: localhost
- name: CVAT_POSTGRES_HOST
value: localhost
- name: CVAT_SHARE_URL
value: /home/django/data
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: data
mountPath: /home/django/data
- name: keys
mountPath: /home/django/keys
- name: logs
mountPath: /home/django/logs
- name: models
mountPath: /home/django/models
- name: share
mountPath: /home/django/share
- name: cvat-ui
image: onepanel/cvat-ui:v0.7.10-stable
ports:
- containerPort: 80
name: http
# Uncomment following lines to enable S3 FileSyncer
# Refer to https://docs.onepanel.ai/docs/getting-started/use-cases/computervision/annotation/cvat/cvat_quick_guide#setting-up-environment-variables
#- name: filesyncer
# image: onepanel/filesyncer:v0.0.4
# command: ['python3', 'main.py']
# volumeMounts:
# - name: share
# mountPath: /mnt/share
ports:
- name: cvat-ui
port: 80
protocol: TCP
targetPort: 80
- name: cvat
port: 8080
protocol: TCP
targetPort: 8080
routes:
- match:
- uri:
regex: /api/.*|/git/.*|/tensorflow/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
- queryParams:
id:
regex: \d+.*
route:
- destination:
port:
number: 8080
timeout: 600s
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 80
timeout: 600s
# DAG Workflow to be executed once a Workspace action completes (optional)
# Uncomment the lines below if you want to send Slack notifications
#postExecutionWorkflow:
# entrypoint: main
# templates:
# - name: main
# dag:
# tasks:
# - name: slack-notify
# template: slack-notify
# - name: slack-notify
# container:
# image: technosophos/slack-notify
# args:
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
# command:
# - sh
# - -c
`
func initialize20200704151301() {
if _, ok := initializedMigrations[20200704151301]; !ok {
goose.AddMigration(Up20200704151301, Down20200704151301)
initializedMigrations[20200704151301] = true
}
}
// Up20200704151301 updates the CVAT template to a new version.
func Up20200704151301(tx *sql.Tx) error {
// This code is executed when the migration is applied.
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200704151301]; ok {
return nil
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
if err != nil {
return err
}
workspaceTemplate := &v1.WorkspaceTemplate{
UID: uid,
Name: cvatTemplateName,
Manifest: cvatWorkspaceTemplate3,
}
for _, namespace := range namespaces {
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
return err
}
}
return nil
}
// Down20200704151301 removes the CVAT template update
func Down20200704151301(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return nil
}

View File

@@ -0,0 +1,204 @@
package migration
import (
"database/sql"
v1 "github.com/onepanelio/core/pkg"
uid2 "github.com/onepanelio/core/pkg/util/uid"
"github.com/pressly/goose"
"strings"
)
const cvatWorkspaceTemplate4 = `# Workspace arguments
arguments:
parameters:
- name: storage-prefix
displayName: Directory in default object storage
value: data
hint: Location of data and models in default object storage, will continuously sync to '/mnt/share'
containers:
- name: cvat-db
image: postgres:10-alpine
env:
- name: POSTGRES_USER
value: root
- name: POSTGRES_DB
value: cvat
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
- name: PGDATA
value: /var/lib/psql/data
ports:
- containerPort: 5432
name: tcp
volumeMounts:
- name: db
mountPath: /var/lib/psql
- name: cvat-redis
image: redis:4.0-alpine
ports:
- containerPort: 6379
name: tcp
- name: cvat
image: onepanel/cvat:v0.7.10-stable
env:
- name: DJANGO_MODWSGI_EXTRA_ARGS
value: ""
- name: ALLOWED_HOSTS
value: '*'
- name: CVAT_REDIS_HOST
value: localhost
- name: CVAT_POSTGRES_HOST
value: localhost
- name: CVAT_SHARE_URL
value: /home/django/data
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: data
mountPath: /home/django/data
- name: keys
mountPath: /home/django/keys
- name: logs
mountPath: /home/django/logs
- name: models
mountPath: /home/django/models
- name: share
mountPath: /home/django/share
- name: sys-namespace-config
mountPath: /etc/onepanel
readOnly: true
- name: cvat-ui
image: onepanel/cvat-ui:v0.7.10-stable
ports:
- containerPort: 80
name: http
# You can add multiple FileSyncer sidecar containers if needed
- name: filesyncer
image: onepanel/filesyncer:{{.ArtifactRepositoryType}}
args:
- download
env:
- name: FS_PATH
value: /mnt/share
- name: FS_PREFIX
value: '{{workspace.parameters.storage-prefix}}'
volumeMounts:
- name: share
mountPath: /mnt/share
- name: sys-namespace-config
mountPath: /etc/onepanel
readOnly: true
ports:
- name: cvat-ui
port: 80
protocol: TCP
targetPort: 80
- name: cvat
port: 8080
protocol: TCP
targetPort: 8080
routes:
- match:
- uri:
regex: /api/.*|/git/.*|/tensorflow/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
- queryParams:
id:
regex: \d+.*
route:
- destination:
port:
number: 8080
timeout: 600s
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 80
timeout: 600s
# DAG Workflow to be executed once a Workspace action completes (optional)
# Uncomment the lines below if you want to send Slack notifications
#postExecutionWorkflow:
# entrypoint: main
# templates:
# - name: main
# dag:
# tasks:
# - name: slack-notify
# template: slack-notify
# - name: slack-notify
# container:
# image: technosophos/slack-notify
# args:
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
# command:
# - sh
# - -c
`
func initialize20200724220450() {
if _, ok := initializedMigrations[20200724220450]; !ok {
goose.AddMigration(Up20200724220450, Down20200724220450)
initializedMigrations[20200724220450] = true
}
}
// Up20200724220450 updates the CVAT template to a new version.
func Up20200724220450(tx *sql.Tx) error {
// This code is executed when the migration is applied.
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200724220450]; ok {
return nil
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
if err != nil {
return err
}
workspaceTemplate := &v1.WorkspaceTemplate{
UID: uid,
Name: cvatTemplateName,
Manifest: cvatWorkspaceTemplate4,
}
for _, namespace := range namespaces {
artifactRepositoryType := "s3"
nsConfig, err := client.GetNamespaceConfig(namespace.Name)
if err != nil {
return err
}
if nsConfig.ArtifactRepository.GCS != nil {
artifactRepositoryType = "gcs"
}
workspaceTemplate.Manifest = strings.NewReplacer(
"{{.ArtifactRepositoryType}}", artifactRepositoryType).Replace(workspaceTemplate.Manifest)
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
return err
}
}
return nil
}
// Down20200724220450 rolls back the CVAT template version
func Down20200724220450(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return nil
}

View File

@@ -0,0 +1,74 @@
package migration
import (
"database/sql"
v1 "github.com/onepanelio/core/pkg"
"github.com/onepanelio/core/pkg/util/pagination"
"github.com/pressly/goose"
)
func initialize20200727144157() {
if _, ok := initializedMigrations[20200727144157]; !ok {
goose.AddMigration(Up20200727144157, Down20200727144157)
initializedMigrations[20200727144157] = true
}
}
// Up20200727144157 will go through all WorkflowTemplateVersion database entries
// and attempt to generate the "parameters" column from the "manifests" column.
func Up20200727144157(tx *sql.Tx) error {
// This code is executed when the migration is applied.
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200727144157]; ok {
return nil
}
pageSize := int32(100)
page := int32(0)
paginator := pagination.NewRequest(page, pageSize)
wtvsResults := -1
for wtvsResults != 0 {
wtvs, err := client.ListWorkflowTemplateVersionsAll(&paginator)
if err != nil {
return err
}
//Exit condition; Check for more results
wtvsResults = len(wtvs)
if wtvsResults > 0 {
page++
paginator = pagination.NewRequest(page, pageSize)
}
for _, wtv := range wtvs {
params, err := v1.ParseParametersFromManifest([]byte(wtv.Manifest))
if err != nil {
return err
}
wtv.Parameters = params
err = client.UpdateWorkflowTemplateVersion(wtv)
if err != nil {
return err
}
}
}
return nil
}
// Down20200727144157 can be run before 20200727155027_add_parameters_col_to_workflow_template_version.sql
// Nothing happens because the referenced SQL file will drop the "parameters" column.
func Down20200727144157(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return nil
}

View File

@@ -0,0 +1,42 @@
package migration
import (
"database/sql"
v1 "github.com/onepanelio/core/pkg"
"github.com/pressly/goose"
)
func initialize20200728190804() {
if _, ok := initializedMigrations[20200728190804]; !ok {
goose.AddMigration(Up20200728190804, Down20200728190804)
initializedMigrations[20200728190804] = true
}
}
// Up20200728190804 is a legacy migration. Due to code changes, it no longer does anything.
// It used to update labels so that we keep track of WorkflowTemplate labels.
// Before, only workflow template versions had labels, but to speed up some queries, we now cache the latest version's labels
// for workflow templates themselves.
func Up20200728190804(tx *sql.Tx) error {
// This code is executed when the migration is applied.
if migrationHasAlreadyBeenRun(20200728190804) {
return nil
}
// Do nothing, be preserve for legacy.
return nil
}
// Down20200728190804 rolls down the migration by deleting all workflow template labels, since they did not exist before this
func Down20200728190804(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
return client.DeleteResourceLabels(tx, v1.TypeWorkflowTemplate)
}

View File

@@ -0,0 +1,484 @@
package migration
import (
"database/sql"
v1 "github.com/onepanelio/core/pkg"
"github.com/pressly/goose"
"log"
)
const maskRCNNWorkflowTemplate = `arguments:
parameters:
- name: source
value: https://github.com/onepanelio/Mask_RCNN.git
displayName: Model source code
type: hidden
visibility: private
- name: sys-annotation-path
value: annotation-dump/sample_dataset
hint: Path to annotated data in default object storage (i.e S3). In CVAT, this parameter will be pre-populated.
displayName: Dataset path
visibility: private
- name: sys-output-path
value: workflow-data/output/sample_output
hint: Path to store output artifacts in default object storage (i.e s3). In CVAT, this parameter will be pre-populated.
displayName: Workflow output path
visibility: private
- name: sys-finetune-checkpoint
value: ''
hint: Select the last fine-tune checkpoint for this model. It may take up to 5 minutes for a recent checkpoint show here. Leave empty if this is the first time you're training this model.
displayName: Checkpoint path
visibility: public
- name: sys-num-classes
displayName: Number of classes
hint: Number of classes (i.e in CVAT taks) + 1 for background
value: 81
visibility: private
- name: extras
displayName: Hyperparameters
visibility: public
type: textarea.textarea
value: |-
stage-1-epochs=1 # Epochs for network heads
stage-2-epochs=2 # Epochs for finetune layers
stage-3-epochs=3 # Epochs for all layers
hint: "Please refer to our <a href='https://docs.onepanel.ai/docs/getting-started/use-cases/computervision/annotation/cvat/cvat_annotation_model#arguments-optional' target='_blank'>documentation</a> for more information on parameters. Number of classes will be automatically populated if you had 'sys-num-classes' parameter in a workflow."
- name: dump-format
type: select.select
value: cvat_coco
displayName: CVAT dump format
visibility: public
options:
- name: 'MS COCO'
value: 'cvat_coco'
- name: 'TF Detection API'
value: 'cvat_tfrecord'
- name: tf-image
visibility: public
value: tensorflow/tensorflow:1.13.1-py3
type: select.select
displayName: Select TensorFlow image
hint: Select the GPU image if you are running on a GPU node pool
options:
- name: 'TensorFlow 1.13.1 CPU Image'
value: 'tensorflow/tensorflow:1.13.1-py3'
- name: 'TensorFlow 1.13.1 GPU Image'
value: 'tensorflow/tensorflow:1.13.1-gpu-py3'
- displayName: Node pool
hint: Name of node pool or group to run this workflow task
type: select.select
visibility: public
name: sys-node-pool
value: Standard_D4s_v3
required: true
options:
- name: 'CPU: 2, RAM: 8GB'
value: Standard_D2s_v3
- name: 'CPU: 4, RAM: 16GB'
value: Standard_D4s_v3
- name: 'GPU: 1xK80, CPU: 6, RAM: 56GB'
value: Standard_NC6
entrypoint: main
templates:
- dag:
tasks:
- name: train-model
template: tensorflow
# Uncomment the lines below if you want to send Slack notifications
# - arguments:
# artifacts:
# - from: '{{tasks.train-model.outputs.artifacts.sys-metrics}}'
# name: metrics
# parameters:
# - name: status
# value: '{{tasks.train-model.status}}'
# dependencies:
# - train-model
# name: notify-in-slack
# template: slack-notify-success
name: main
- container:
args:
- |
apt-get update \
&& apt-get install -y git wget libglib2.0-0 libsm6 libxext6 libxrender-dev \
&& pip install -r requirements.txt \
&& pip install boto3 pyyaml google-cloud-storage \
&& git clone https://github.com/waleedka/coco \
&& cd coco/PythonAPI \
&& python setup.py build_ext install \
&& rm -rf build \
&& cd ../../ \
&& wget https://github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_coco.h5 \
&& python setup.py install && ls \
&& python samples/coco/cvat.py train --dataset=/mnt/data/datasets \
--model=workflow_maskrcnn \
--extras="{{workflow.parameters.extras}}" \
--ref_model_path="{{workflow.parameters.sys-finetune-checkpoint}}" \
--num_classes="{{workflow.parameters.sys-num-classes}}" \
&& cd /mnt/src/ \
&& python prepare_dataset.py /mnt/data/datasets/annotations/instances_default.json
command:
- sh
- -c
image: '{{workflow.parameters.tf-image}}'
volumeMounts:
- mountPath: /mnt/data
name: data
- mountPath: /mnt/output
name: output
workingDir: /mnt/src
nodeSelector:
beta.kubernetes.io/instance-type: '{{workflow.parameters.sys-node-pool}}'
inputs:
artifacts:
- name: data
path: /mnt/data/datasets/
s3:
key: '{{workflow.namespace}}/{{workflow.parameters.sys-annotation-path}}'
- git:
repo: '{{workflow.parameters.source}}'
revision: "no-boto"
name: src
path: /mnt/src
name: tensorflow
outputs:
artifacts:
- name: model
optional: true
path: /mnt/output
s3:
key: '{{workflow.namespace}}/{{workflow.parameters.sys-output-path}}'
# Uncomment the lines below if you want to send Slack notifications
#- container:
# args:
# - SLACK_USERNAME=Onepanel SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}"
# SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd
# SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify
# command:
# - sh
# - -c
# image: technosophos/slack-notify
# inputs:
# artifacts:
# - name: metrics
# optional: true
# path: /tmp/metrics.json
# parameters:
# - name: status
# name: slack-notify-success
volumeClaimTemplates:
- metadata:
creationTimestamp: null
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Gi
- metadata:
creationTimestamp: null
name: output
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Gi`
const maskRCNNWorkflowTemplateName = "MaskRCNN Training"
const tensorflowWorkflowTemplate2 = `arguments:
parameters:
- name: source
value: https://github.com/tensorflow/models.git
displayName: Model source code
type: hidden
visibility: private
- name: trainingsource
value: https://github.com/onepanelio/cvat-training.git
type: hidden
- name: revision
value: v1.13.0
type: hidden
- name: sys-annotation-path
value: annotation-dump/sample_dataset
displayName: Dataset path
hint: Path to annotated data in default object storage (i.e S3). In CVAT, this parameter will be pre-populated.
- name: sys-output-path
value: workflow-data/output/sample_output
hint: Path to store output artifacts in default object storage (i.e s3). In CVAT, this parameter will be pre-populated.
displayName: Workflow output path
- name: ref-model
value: frcnn-res50-coco
displayName: Model
hint: TF Detection API's model to use for training.
type: select.select
visibility: public
options:
- name: 'Faster RCNN-ResNet 101-COCO'
value: frcnn-res101-coco
- name: 'Faster RCNN-ResNet 101-Low Proposal-COCO'
value: frcnn-res101-low
- name: 'Faster RCNN-ResNet 50-COCO'
value: frcnn-res50-coco
- name: 'Faster RCNN-NAS-COCO'
value: frcnn-nas-coco
- name: 'SSD MobileNet V1-COCO'
value: ssd-mobilenet-v1-coco2
- name: 'SSD MobileNet V2-COCO'
value: ssd-mobilenet-v2-coco
- name: 'SSDLite MobileNet-COCO'
value: ssdlite-mobilenet-coco
- name: extras
value: |-
epochs=1000
displayName: Hyperparameters
visibility: public
type: textarea.textarea
hint: "Please refer to our <a href='https://docs.onepanel.ai/docs/getting-started/use-cases/computervision/annotation/cvat/cvat_annotation_model#arguments-optional' target='_blank'>documentation</a> for more information on parameters. Number of classes will be automatically populated if you had 'sys-num-classes' parameter in a workflow."
- name: sys-finetune-checkpoint
value: ''
hint: Select the last fine-tune checkpoint for this model. It may take up to 5 minutes for a recent checkpoint show here. Leave empty if this is the first time you're training this model.
displayName: Checkpoint path
visibility: public
- name: sys-num-classes
value: 81
hint: Number of classes
displayName: Number of classes
visibility: private
- name: tf-image
value: tensorflow/tensorflow:1.13.1-py3
type: select.select
displayName: Select TensorFlow image
visibility: public
hint: Select the GPU image if you are running on a GPU node pool
options:
- name: 'TensorFlow 1.13.1 CPU Image'
value: 'tensorflow/tensorflow:1.13.1-py3'
- name: 'TensorFlow 1.13.1 GPU Image'
value: 'tensorflow/tensorflow:1.13.1-gpu-py3'
- displayName: Node pool
hint: Name of node pool or group to run this workflow task
type: select.select
name: sys-node-pool
value: Standard_D4s_v3
visibility: public
required: true
options:
- name: 'CPU: 2, RAM: 8GB'
value: Standard_D2s_v3
- name: 'CPU: 4, RAM: 16GB'
value: Standard_D4s_v3
- name: 'GPU: 1xK80, CPU: 6, RAM: 56GB'
value: Standard_NC6
- name: dump-format
value: cvat_tfrecord
visibility: public
entrypoint: main
templates:
- dag:
tasks:
- name: train-model
template: tensorflow
# Uncomment the lines below if you want to send Slack notifications
# - arguments:
# artifacts:
# - from: '{{tasks.train-model.outputs.artifacts.sys-metrics}}'
# name: metrics
# parameters:
# - name: status
# value: '{{tasks.train-model.status}}'
# dependencies:
# - train-model
# name: notify-in-slack
# template: slack-notify-success
name: main
- container:
args:
- |
apt-get update && \
apt-get install -y python3-pip git wget unzip libglib2.0-0 libsm6 libxext6 libxrender-dev && \
pip install pillow lxml Cython contextlib2 jupyter matplotlib numpy scipy boto3 pycocotools pyyaml google-cloud-storage && \
cd /mnt/src/tf/research && \
export PYTHONPATH=$PYTHONPATH:` + "pwd`:`pwd`/slim" + `&& \
cd /mnt/src/train && \
python convert_workflow.py \
--extras="{{workflow.parameters.extras}}" \
--model="{{workflow.parameters.ref-model}}" \
--num_classes="{{workflow.parameters.sys-num-classes}}" \
--sys_finetune_checkpoint={{workflow.parameters.sys-finetune-checkpoint}}
command:
- sh
- -c
image: '{{workflow.parameters.tf-image}}'
volumeMounts:
- mountPath: /mnt/data
name: data
- mountPath: /mnt/output
name: output
workingDir: /mnt/src
nodeSelector:
beta.kubernetes.io/instance-type: '{{workflow.parameters.sys-node-pool}}'
inputs:
artifacts:
- name: data
path: /mnt/data/datasets/
s3:
key: '{{workflow.namespace}}/{{workflow.parameters.sys-annotation-path}}'
- name: models
path: /mnt/data/models/
optional: true
s3:
key: '{{workflow.namespace}}/{{workflow.parameters.sys-finetune-checkpoint}}'
- git:
repo: '{{workflow.parameters.source}}'
revision: '{{workflow.parameters.revision}}'
name: src
path: /mnt/src/tf
- git:
repo: '{{workflow.parameters.trainingsource}}'
revision: 'optional-artifacts'
name: tsrc
path: /mnt/src/train
name: tensorflow
outputs:
artifacts:
- name: model
optional: true
path: /mnt/output
s3:
key: '{{workflow.namespace}}/{{workflow.parameters.sys-output-path}}'
# Uncomment the lines below if you want to send Slack notifications
#- container:
# args:
# - SLACK_USERNAME=Onepanel SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}"
# SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd
# SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify
# command:
# - sh
# - -c
# image: technosophos/slack-notify
# inputs:
# artifacts:
# - name: metrics
# optional: true
# path: /tmp/metrics.json
# parameters:
# - name: status
# name: slack-notify-success
volumeClaimTemplates:
- metadata:
creationTimestamp: null
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Gi
- metadata:
creationTimestamp: null
name: output
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Gi`
func initialize20200812104328() {
if _, ok := initializedMigrations[20200812104328]; !ok {
goose.AddMigration(Up20200812104328, Down20200812104328)
initializedMigrations[20200812104328] = true
}
}
func Up20200812104328(tx *sql.Tx) error {
// This code is executed when the migration is applied.
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200812104328]; ok {
return nil
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
// Create maskrcnn
workflowTemplate := &v1.WorkflowTemplate{
Name: maskRCNNWorkflowTemplateName,
Manifest: maskRCNNWorkflowTemplate,
}
if err := workflowTemplate.GenerateUID(workflowTemplate.Name); err != nil {
return err
}
for _, namespace := range namespaces {
existingWorkflowTemplate, err := client.GetLatestWorkflowTemplate(namespace.Name, workflowTemplate.UID)
if err != nil {
return err
}
if existingWorkflowTemplate != nil {
log.Printf("Skipping creating template '%v'. It already exists in namespace '%v'", workflowTemplate.Name, namespace.Name)
continue
}
if _, err := client.CreateWorkflowTemplate(namespace.Name, workflowTemplate); err != nil {
return err
}
}
// Update tf-od
workflowTemplate = &v1.WorkflowTemplate{
Name: tensorflowWorkflowTemplateName,
Manifest: tensorflowWorkflowTemplate2,
}
if err := workflowTemplate.GenerateUID(workflowTemplate.Name); err != nil {
return err
}
for _, namespace := range namespaces {
if _, err := client.CreateWorkflowTemplateVersion(namespace.Name, workflowTemplate); err != nil {
return err
}
}
return nil
}
func Down20200812104328(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return nil
}

View File

@@ -0,0 +1,204 @@
package migration
import (
"database/sql"
v1 "github.com/onepanelio/core/pkg"
uid2 "github.com/onepanelio/core/pkg/util/uid"
"github.com/pressly/goose"
"strings"
)
const cvatWorkspaceTemplate5 = `# Workspace arguments
arguments:
parameters:
- name: sync-directory
displayName: Directory to sync raw input and training output
value: workflow-data
hint: Location to sync raw input, models and checkpoints from default object storage. Note that this will be relative to the current namespace.
containers:
- name: cvat-db
image: postgres:10-alpine
env:
- name: POSTGRES_USER
value: root
- name: POSTGRES_DB
value: cvat
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
- name: PGDATA
value: /var/lib/psql/data
ports:
- containerPort: 5432
name: tcp
volumeMounts:
- name: db
mountPath: /var/lib/psql
- name: cvat-redis
image: redis:4.0-alpine
ports:
- containerPort: 6379
name: tcp
- name: cvat
image: onepanel/cvat:0.12.0_cvat.1.0.0-beta.2
env:
- name: DJANGO_MODWSGI_EXTRA_ARGS
value: ""
- name: ALLOWED_HOSTS
value: '*'
- name: CVAT_REDIS_HOST
value: localhost
- name: CVAT_POSTGRES_HOST
value: localhost
- name: CVAT_SHARE_URL
value: /home/django/data
- name: ONEPANEL_SYNC_DIRECTORY
value: '{{workspace.parameters.sync-directory}}'
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: data
mountPath: /home/django/data
- name: keys
mountPath: /home/django/keys
- name: logs
mountPath: /home/django/logs
- name: models
mountPath: /home/django/models
- name: share
mountPath: /home/django/share
- name: sys-namespace-config
mountPath: /etc/onepanel
readOnly: true
- name: cvat-ui
image: onepanel/cvat-ui:0.12.0_cvat.1.0.0-beta.2
ports:
- containerPort: 80
name: http
# You can add multiple FileSyncer sidecar containers if needed
- name: filesyncer
image: onepanel/filesyncer:s3
imagePullPolicy: Always
args:
- download
env:
- name: FS_PATH
value: /mnt/share
- name: FS_PREFIX
value: '{{workflow.namespace}}/{{workspace.parameters.sync-directory}}'
volumeMounts:
- name: share
mountPath: /mnt/share
- name: sys-namespace-config
mountPath: /etc/onepanel
readOnly: true
ports:
- name: cvat-ui
port: 80
protocol: TCP
targetPort: 80
- name: cvat
port: 8080
protocol: TCP
targetPort: 8080
routes:
- match:
- uri:
regex: /api/.*|/git/.*|/tensorflow/.*|/onepanelio/.*|/tracking/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
- queryParams:
id:
regex: \d+.*
route:
- destination:
port:
number: 8080
timeout: 600s
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 80
timeout: 600s
# DAG Workflow to be executed once a Workspace action completes (optional)
# Uncomment the lines below if you want to send Slack notifications
#postExecutionWorkflow:
# entrypoint: main
# templates:
# - name: main
# dag:
# tasks:
# - name: slack-notify
# template: slack-notify
# - name: slack-notify
# container:
# image: technosophos/slack-notify
# args:
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
# command:
# - sh
# - -c`
func initialize20200812113316() {
if _, ok := initializedMigrations[20200812113316]; !ok {
goose.AddMigration(Up20200812113316, Down20200812113316)
initializedMigrations[20200812113316] = true
}
}
func Up20200812113316(tx *sql.Tx) error {
// This code is executed when the migration is applied.
client, err := getClient()
if err != nil {
return err
}
defer client.DB.Close()
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
return err
}
if _, ok := migrationsRan[20200812113316]; ok {
return nil
}
namespaces, err := client.ListOnepanelEnabledNamespaces()
if err != nil {
return err
}
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
if err != nil {
return err
}
workspaceTemplate := &v1.WorkspaceTemplate{
UID: uid,
Name: cvatTemplateName,
Manifest: cvatWorkspaceTemplate5,
}
for _, namespace := range namespaces {
artifactRepositoryType := "s3"
nsConfig, err := client.GetNamespaceConfig(namespace.Name)
if err != nil {
return err
}
if nsConfig.ArtifactRepository.GCS != nil {
artifactRepositoryType = "gcs"
}
workspaceTemplate.Manifest = strings.NewReplacer(
"{{.ArtifactRepositoryType}}", artifactRepositoryType).Replace(workspaceTemplate.Manifest)
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
return err
}
}
return nil
}
func Down20200812113316(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return nil
}

91
db/go/db.go Normal file
View File

@@ -0,0 +1,91 @@
package migration
import (
sq "github.com/Masterminds/squirrel"
"github.com/jmoiron/sqlx"
v1 "github.com/onepanelio/core/pkg"
"log"
)
// initializedMigrations is used to keep track of which migrations have been initialized.
// if they are initialized more than once, goose panics.
var initializedMigrations = make(map[int]bool)
// sqlRanMigrations keeps track of all the sql migrations that have been run.
// we need to know this because in an older version some go migrations ran alongside sql.
// So if they have already been run, we can't run them again.
var sqlRanMigrations = make(map[uint64]bool)
// migrationHasAlreadyBeenRun returns true if the migration has already been run in sql
// see sqlRanMigrations var
func migrationHasAlreadyBeenRun(version int) bool {
_, ok := sqlRanMigrations[uint64(version)]
return ok
}
// Initialize sets up the go migrations.
func Initialize() {
client, err := getClient()
if err != nil {
log.Fatalf("unable to get client for go migrations: %v", err)
}
migrationsRan, err := getRanSQLMigrations(client)
if err != nil {
log.Fatalf("Unable to get already run sql migrations: %v", err)
}
sqlRanMigrations = migrationsRan
initialize20200525160514()
initialize20200528140124()
initialize20200605090509()
initialize20200605090535()
initialize20200626113635()
initialize20200704151301()
initialize20200724220450()
initialize20200727144157()
initialize20200728190804()
initialize20200812104328()
initialize20200812113316()
if err := client.DB.Close(); err != nil {
log.Printf("[error] closing db %v", err)
}
}
func getClient() (*v1.Client, error) {
kubeConfig := v1.NewConfig()
client, err := v1.NewClient(kubeConfig, nil, nil)
if err != nil {
return nil, err
}
config, err := client.GetSystemConfig()
if err != nil {
return nil, err
}
dbDriverName, dbDataSourceName := config.DatabaseConnection()
client.DB = v1.NewDB(sqlx.MustConnect(dbDriverName, dbDataSourceName))
return client, nil
}
// getRanSQLMigrations returns a map where each key is a sql migration version ran.
func getRanSQLMigrations(client *v1.Client) (map[uint64]bool, error) {
sb := sq.StatementBuilder.PlaceholderFormat(sq.Dollar)
query := sb.Select("version_id").
From("goose_db_version")
versions := make([]uint64, 0)
if err := client.Selectx(&versions, query); err != nil {
return nil, err
}
result := make(map[uint64]bool)
for _, version := range versions {
result[version] = true
}
return result, nil
}

View File

@@ -2,7 +2,7 @@
CREATE TABLE workflow_template_versions
(
id serial PRIMARY KEY,
uid varchar(30) UNIQUE NOT NULL CHECK(uid <> ''),
uid varchar(30),
workflow_template_id integer NOT NULL REFERENCES workflow_templates ON DELETE CASCADE,
version integer NOT NULL,
is_latest boolean NOT NULL,

View File

@@ -0,0 +1,5 @@
-- +goose Up
ALTER TABLE workflow_template_versions DROP COLUMN uid;
-- +goose Down
UPDATE workflow_template_versions SET uid = version::text;

View File

@@ -0,0 +1,7 @@
-- +goose Up
ALTER TABLE workspaces DROP COLUMN url;
-- +goose Down
ALTER TABLE workspaces ADD COLUMN url TEXT;
UPDATE workspaces set url = '';
ALTER TABLE workspaces ALTER COLUMN url SET NOT NULL;

View File

@@ -0,0 +1,11 @@
-- +goose Up
-- SQL in this section is executed when the migration is applied.
ALTER TABLE workflow_template_versions ALTER COLUMN version TYPE BIGINT;
ALTER TABLE workspace_template_versions ALTER COLUMN version TYPE BIGINT;
ALTER TABLE workspaces ALTER COLUMN workspace_template_version TYPE BIGINT;
-- +goose Down
-- SQL in this section is executed when the migration is rolled back.
ALTER TABLE workflow_template_versions ALTER COLUMN version TYPE INT;
ALTER TABLE workspace_template_versions ALTER COLUMN version TYPE INT;
ALTER TABLE workspaces ALTER COLUMN workspace_template_version TYPE INT;

View File

@@ -0,0 +1,7 @@
-- +goose Up
ALTER TABLE workflow_template_versions ADD COLUMN parameters JSONB;
UPDATE workflow_template_versions SET parameters = '[]'::JSONB;
ALTER TABLE workflow_template_versions ALTER COLUMN parameters SET NOT NULL;
-- +goose Down
ALTER TABLE workflow_template_versions DROP COLUMN parameters;

View File

@@ -0,0 +1,195 @@
-- +goose Up
-- SQL in this section is executed when the migration is applied.
ALTER TABLE workflow_templates ADD COLUMN labels JSONB DEFAULT '{}'::JSONB;
ALTER TABLE workflow_template_versions ADD COLUMN labels JSONB DEFAULT '{}'::JSONB;
ALTER TABLE workflow_executions ADD COLUMN labels JSONB DEFAULT '{}'::JSONB;
ALTER TABLE workspaces ADD COLUMN labels JSONB DEFAULT '{}'::JSONB;
ALTER TABLE workspace_templates ADD COLUMN labels JSONB DEFAULT '{}'::JSONB;
ALTER TABLE workspace_template_versions ADD COLUMN labels JSONB DEFAULT '{}'::JSONB;
ALTER TABLE cron_workflows ADD COLUMN labels JSONB DEFAULT '{}'::JSONB;
-- We take the old labels and put them into the new jsonb columns
UPDATE workflow_templates wt
SET labels =
(
SELECT jsonb_object_agg(key, value)
FROM labels l
WHERE resource = 'workflow_template'
AND wt.id = l.resource_id
)
;
UPDATE workflow_templates SET labels = '{}'::jsonb WHERE labels IS NULL;
UPDATE workflow_template_versions wtv
SET labels =
(
SELECT jsonb_object_agg(key, value)
FROM labels l
WHERE resource = 'workflow_template_version'
AND wtv.id = l.resource_id
)
;
UPDATE workflow_template_versions SET labels = '{}'::jsonb WHERE labels IS NULL;
UPDATE workflow_executions we
SET labels =
(
SELECT jsonb_object_agg(key, value)
FROM labels l
WHERE resource = 'workflow_execution'
AND we.id = l.resource_id
)
;
UPDATE workflow_executions SET labels = '{}'::jsonb WHERE labels IS NULL;
UPDATE workspaces w
SET labels =
(
SELECT jsonb_object_agg(key, value)
FROM labels l
WHERE resource = 'workspace'
AND w.id = l.resource_id
)
;
UPDATE workspaces SET labels = '{}'::jsonb WHERE labels IS NULL;
UPDATE workspace_templates wt
SET labels =
(
SELECT jsonb_object_agg(key, value)
FROM labels l
WHERE resource = 'workspace_template'
AND wt.id = l.resource_id
)
;
UPDATE workspace_templates SET labels = '{}'::jsonb WHERE labels IS NULL;
UPDATE workspace_template_versions wtv
SET labels =
(
SELECT jsonb_object_agg(key, value)
FROM labels l
WHERE resource = 'workspace_template_version'
AND wtv.id = l.resource_id
)
;
UPDATE workspace_template_versions SET labels = '{}'::jsonb WHERE labels IS NULL;
UPDATE cron_workflows cw
SET labels =
(
SELECT jsonb_object_agg(key, value)
FROM labels l
WHERE resource = 'cron_workflow'
AND cw.id = l.resource_id
)
;
UPDATE cron_workflows SET labels = '{}'::jsonb WHERE labels IS NULL;
DROP table labels;
-- +goose Down
-- SQL in this section is executed when the migration is rolled back.
-- We take the jsonb column labels and put them back into a separate labels table
CREATE TABLE labels
(
id serial PRIMARY KEY,
key character varying(255),
value character varying(255),
resource character varying(255),
resource_id integer,
created_at timestamp without time zone NOT NULL DEFAULT timezone('utc'::text, now())
);
INSERT INTO labels(key, value, resource, resource_id, created_at)
SELECT key, value, 'cron_workflow', id, now()
FROM (
SELECT wt1.id as id, wt1.key as key, wt2.labels->>wt1.key as value
FROM cron_workflows wt2
JOIN (
SELECT wt.id, jsonb_object_keys(wt.labels) as key
FROM cron_workflows wt
) wt1 on wt2.id = wt1.id
) subquery
;
INSERT INTO labels(key, value, resource, resource_id, created_at)
SELECT key, value, 'workflow_template_version', id, now()
FROM (
SELECT wt1.id as id, wt1.key as key, wt2.labels->>wt1.key as value
FROM workflow_template_versions wt2
JOIN (
SELECT wt.id, jsonb_object_keys(wt.labels) as key
FROM workflow_template_versions wt
) wt1 on wt2.id = wt1.id
) subquery
;
INSERT INTO labels(key, value, resource, resource_id, created_at)
SELECT key, value, 'workspace_template', id, now()
FROM (
SELECT wt1.id as id, wt1.key as key, wt2.labels->>wt1.key as value
FROM workspace_templates wt2
JOIN (
SELECT wt.id, jsonb_object_keys(wt.labels) as key
FROM workspace_templates wt
) wt1 on wt2.id = wt1.id
) subquery
;
INSERT INTO labels(key, value, resource, resource_id, created_at)
SELECT key, value, 'workspace', id, now()
FROM (
SELECT wt1.id as id, wt1.key as key, wt2.labels->>wt1.key as value
FROM workspaces wt2
JOIN (
SELECT wt.id, jsonb_object_keys(wt.labels) as key
FROM workspaces wt
) wt1 on wt2.id = wt1.id
) subquery
;
INSERT INTO labels(key, value, resource, resource_id, created_at)
SELECT key, value, 'workflow_execution', id, now()
FROM (
SELECT wt1.id as id, wt1.key as key, wt2.labels->>wt1.key as value
FROM workflow_executions wt2
JOIN (
SELECT wt.id, jsonb_object_keys(wt.labels) as key
FROM workflow_executions wt
) wt1 on wt2.id = wt1.id
) subquery
;
INSERT INTO labels(key, value, resource, resource_id, created_at)
SELECT key, value, 'workflow_template_version', id, now()
FROM (
SELECT wt1.id as id, wt1.key as key, wt2.labels->>wt1.key as value
FROM workflow_template_versions wt2
JOIN (
SELECT wt.id, jsonb_object_keys(wt.labels) as key
FROM workflow_template_versions wt
) wt1 on wt2.id = wt1.id
) subquery
;
INSERT INTO labels(key, value, resource, resource_id, created_at)
SELECT key, value, 'workflow_template', id, now()
FROM (
SELECT wt1.id as id, wt1.key as key, wt2.labels->>wt1.key as value
FROM workflow_templates wt2
JOIN (
SELECT wt.id, jsonb_object_keys(wt.labels) as key
FROM workflow_templates wt
) wt1 on wt2.id = wt1.id
) subquery
;
ALTER TABLE cron_workflows DROP COLUMN labels;
ALTER TABLE workspace_template_versions DROP COLUMN labels;
ALTER TABLE workspace_templates DROP COLUMN labels;
ALTER TABLE workspaces DROP COLUMN labels;
ALTER TABLE workflow_executions DROP COLUMN labels;
ALTER TABLE workflow_template_versions DROP COLUMN labels;
ALTER TABLE workflow_templates DROP COLUMN labels;

View File

@@ -0,0 +1,7 @@
-- +goose Up
-- SQL in this section is executed when the migration is applied.
ALTER TABLE workspace_templates ADD COLUMN description TEXT DEFAULT '';
-- +goose Down
-- SQL in this section is executed when the migration is rolled back.
ALTER TABLE workspace_templates DROP COLUMN description;

8
go.mod
View File

@@ -4,6 +4,7 @@ go 1.14
require (
github.com/Azure/go-autorest v14.0.0+incompatible // indirect
cloud.google.com/go/storage v1.6.0
github.com/Azure/go-autorest/autorest/adal v0.8.2 // indirect
github.com/Masterminds/squirrel v1.1.0
github.com/argoproj/argo v0.0.0-20200331233432-4d1175eb68f6
@@ -14,11 +15,10 @@ require (
github.com/ghodss/yaml v1.0.0
github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/golang/protobuf v1.4.1
github.com/google/uuid v1.1.1
github.com/gorilla/handlers v1.4.2
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
github.com/grpc-ecosystem/grpc-gateway v1.14.4
github.com/hashicorp/go-uuid v1.0.2
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/jmoiron/sqlx v1.2.0
github.com/lib/pq v1.3.0
@@ -30,10 +30,14 @@ require (
github.com/spf13/cobra v0.0.5 // indirect
github.com/stretchr/testify v1.4.0
github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
google.golang.org/api v0.20.0
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84
google.golang.org/grpc v1.28.0
google.golang.org/protobuf v1.22.0
gopkg.in/yaml.v2 v2.2.8
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
istio.io/api v0.0.0-20200107183329-ed4b507c54e1
k8s.io/api v0.16.4
k8s.io/apimachinery v0.16.7-beta.0

23
go.sum
View File

@@ -12,14 +12,18 @@ cloud.google.com/go v0.55.0 h1:eoz/lYxKSL4CNAiaUJ0ZfD1J3bfMYbU5B3rwM1C1EIU=
cloud.google.com/go v0.55.0/go.mod h1:ZHmoY+/lIMNkN2+fBmuTiqZ4inFhvQad8ft7MT8IV5Y=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0 h1:UDpwYIwla4jHGzZJaEJYx1tOejbgSoNqsAfHAUYe2r8=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/go-autorest v11.1.2+incompatible h1:viZ3tV5l4gE2Sw0xrasFHytCGtzYCrT+um/rrSQ1BfA=
@@ -31,8 +35,6 @@ github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+B
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.2 h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0=
github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/adal v0.8.3 h1:O1AGG9Xig71FxdX9HO5pGNyZ7TbSyHaVg+5eJO/jSGw=
github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM=
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
@@ -44,6 +46,7 @@ github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1Gn
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
@@ -207,6 +210,7 @@ github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSN
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
@@ -218,6 +222,7 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk=
@@ -237,8 +242,6 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xC
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 h1:0IKlLyQ3Hs9nDaiK5cSHAGmcQEIC8l2Ts1u6x5Dfrqg=
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s=
github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c=
github.com/grpc-ecosystem/grpc-gateway v1.14.3 h1:OCJlWkOUoTnl0neNGlf4fUm3TmbEtguw7vR+nGtnDjY=
github.com/grpc-ecosystem/grpc-gateway v1.14.3/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0=
github.com/grpc-ecosystem/grpc-gateway v1.14.4 h1:IOPK2xMPP3aV6/NPt4jt//ELFo3Vv8sDVD8j3+tleDU=
github.com/grpc-ecosystem/grpc-gateway v1.14.4/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0=
github.com/hashicorp/go-uuid v0.0.0-20180228145832-27454136f036/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
@@ -275,6 +278,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u
github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
@@ -437,6 +441,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
@@ -479,6 +484,7 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
@@ -486,6 +492,7 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -527,6 +534,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -608,6 +616,7 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200317043434-63da46f3035e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312 h1:2PHG+Ia3gK1K2kjxZnSylizb//eyaMG8gDFbOG7wLV8=
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -622,6 +631,7 @@ google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsb
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.20.0 h1:jz2KixHX7EcCPiQrySzPdnYT7DbINAypCqKZ1Z7GM40=
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -648,8 +658,6 @@ google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200317114155-1f3552e48f24/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200413115906-b5235f65be36 h1:j7CmVRD4Kec0+f8VuBAc2Ak2MFfXm5Q2/RxuJLL+76E=
google.golang.org/genproto v0.0.0-20200413115906-b5235f65be36/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84 h1:pSLkPbrjnPyLDYUO2VM9mDLqo2V6CFBY84lFSZAfoi4=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
@@ -711,11 +719,14 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
istio.io/api v0.0.0-20200107183329-ed4b507c54e1 h1:q4xggEkhMn4RMRo8AJVNmMtNzy514DGiAUxRDDKPhZU=
istio.io/api v0.0.0-20200107183329-ed4b507c54e1/go.mod h1:+cyHH83OwC0rFpwk8eXctzPNpiCAbB+r6kmMiAxxBHw=

172
main.go
View File

@@ -4,11 +4,19 @@ import (
"context"
"flag"
"fmt"
"net"
"net/http"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
corev1 "k8s.io/api/core/v1"
apiv1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
k8runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/tools/cache"
"math"
"net"
"net/http"
"path/filepath"
"strings"
"github.com/gorilla/handlers"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
@@ -17,6 +25,7 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/jmoiron/sqlx"
"github.com/onepanelio/core/api"
migrations "github.com/onepanelio/core/db/go"
v1 "github.com/onepanelio/core/pkg"
"github.com/onepanelio/core/pkg/util/env"
"github.com/onepanelio/core/server"
@@ -36,29 +45,64 @@ var (
func main() {
flag.Parse()
kubeConfig := v1.NewConfig()
client, err := v1.NewClient(kubeConfig, nil)
if err != nil {
log.Fatalf("Failed to connect to Kubernetes cluster: %v", err)
}
config, err := client.GetSystemConfig()
if err != nil {
log.Fatalf("Failed to get system config: %v", err)
}
// stopCh is used to indicate when the RPC server should reload.
// We do this when the configuration has been changed, so the server has the latest configuration
stopCh := make(chan struct{})
databaseDataSourceName := fmt.Sprintf("host=%v user=%v password=%v dbname=%v sslmode=disable",
config["databaseHost"], config["databaseUsername"], config["databasePassword"], config["databaseName"])
go func() {
kubeConfig := v1.NewConfig()
client, err := v1.NewClient(kubeConfig, nil, nil)
if err != nil {
log.Fatalf("Failed to connect to Kubernetes cluster: %v", err)
}
db := sqlx.MustConnect(config["databaseDriverName"], databaseDataSourceName)
if err := goose.Run("up", db.DB, "db"); err != nil {
log.Fatalf("Failed to run database migrations: %v", err)
}
go watchConfigmapChanges(client, "onepanel", stopCh, func(configMap *corev1.ConfigMap) error {
log.Printf("Configmap changed")
stopCh <- struct{}{}
return nil
})
for {
client.ClearSystemConfigCache()
sysConfig, err := client.GetSystemConfig()
if err != nil {
log.Fatalf("Failed to get system config: %v", err)
}
dbDriverName, databaseDataSourceName := sysConfig.DatabaseConnection()
// sqlx.MustConnect will panic when it can't connect to DB. In that case, this whole application will crash.
// This is okay, as the pod will restart and try connecting to DB again.
// dbDriverName may be nil, but sqlx will then panic.
db := sqlx.MustConnect(dbDriverName, databaseDataSourceName)
goose.SetTableName("goose_db_version")
if err := goose.Run("up", db.DB, filepath.Join("db", "sql")); err != nil {
log.Fatalf("Failed to run database sql migrations: %v", err)
db.Close()
}
goose.SetTableName("goose_db_go_version")
migrations.Initialize()
if err := goose.Run("up", db.DB, filepath.Join("db", "go")); err != nil {
log.Fatalf("Failed to run database go migrations: %v", err)
db.Close()
}
s := startRPCServer(v1.NewDB(db), kubeConfig, sysConfig, stopCh)
<-stopCh
s.Stop()
if err := db.Close(); err != nil {
log.Printf("[error] closing db connection")
}
}
}()
go startRPCServer(db, kubeConfig)
startHTTPProxy()
}
func startRPCServer(db *v1.DB, kubeConfig *v1.Config) {
func startRPCServer(db *v1.DB, kubeConfig *v1.Config, sysConfig v1.SystemConfig, stopCh chan struct{}) *grpc.Server {
log.Printf("Starting RPC server on port %v", *rpcPort)
lis, err := net.Listen("tcp", *rpcPort)
if err != nil {
@@ -85,13 +129,13 @@ func startRPCServer(db *v1.DB, kubeConfig *v1.Config) {
grpc_middleware.ChainUnaryServer(
grpc_logrus.UnaryServerInterceptor(logEntry),
grpc_recovery.UnaryServerInterceptor(recoveryOpts...),
auth.UnaryInterceptor(kubeConfig, db)),
auth.UnaryInterceptor(kubeConfig, db, sysConfig)),
), grpc.StreamInterceptor(
grpc_middleware.ChainStreamServer(
grpc_logrus.StreamServerInterceptor(logEntry),
grpc_recovery.StreamServerInterceptor(recoveryOpts...),
auth.StreamingInterceptor(kubeConfig, db)),
))
auth.StreamingInterceptor(kubeConfig, db, sysConfig)),
), grpc.MaxRecvMsgSize(math.MaxInt64), grpc.MaxSendMsgSize(math.MaxInt64))
api.RegisterWorkflowTemplateServiceServer(s, server.NewWorkflowTemplateServer())
api.RegisterCronWorkflowServiceServer(s, server.NewCronWorkflowServer())
api.RegisterWorkflowServiceServer(s, server.NewWorkflowServer())
@@ -101,10 +145,18 @@ func startRPCServer(db *v1.DB, kubeConfig *v1.Config) {
api.RegisterLabelServiceServer(s, server.NewLabelServer())
api.RegisterWorkspaceTemplateServiceServer(s, server.NewWorkspaceTemplateServer())
api.RegisterWorkspaceServiceServer(s, server.NewWorkspaceServer())
api.RegisterConfigServiceServer(s, server.NewConfigServer())
api.RegisterServiceServiceServer(s, server.NewServiceServer())
if err := s.Serve(lis); err != nil {
log.Fatalf("Failed to serve RPC server: %v", err)
}
go func() {
if err := s.Serve(lis); err != nil {
log.Fatalf("Failed to serve RPC server: %v", err)
}
log.Printf("Server finished")
}()
return s
}
func startHTTPProxy() {
@@ -115,8 +167,9 @@ func startHTTPProxy() {
// Register gRPC server endpoint
// Note: Make sure the gRPC server is running properly and accessible
mux := runtime.NewServeMux()
opts := []grpc.DialOption{grpc.WithInsecure()}
mux := runtime.NewServeMux(runtime.WithIncomingHeaderMatcher(customHeaderMatcher))
opts := []grpc.DialOption{grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(math.MaxInt64),
grpc.MaxCallRecvMsgSize(math.MaxInt64))}
registerHandler(api.RegisterWorkflowTemplateServiceHandlerFromEndpoint, ctx, mux, endpoint, opts)
registerHandler(api.RegisterWorkflowServiceHandlerFromEndpoint, ctx, mux, endpoint, opts)
@@ -127,6 +180,8 @@ func startHTTPProxy() {
registerHandler(api.RegisterLabelServiceHandlerFromEndpoint, ctx, mux, endpoint, opts)
registerHandler(api.RegisterWorkspaceTemplateServiceHandlerFromEndpoint, ctx, mux, endpoint, opts)
registerHandler(api.RegisterWorkspaceServiceHandlerFromEndpoint, ctx, mux, endpoint, opts)
registerHandler(api.RegisterConfigServiceHandlerFromEndpoint, ctx, mux, endpoint, opts)
registerHandler(api.RegisterServiceServiceHandlerFromEndpoint, ctx, mux, endpoint, opts)
log.Printf("Starting HTTP proxy on port %v", *httpPort)
@@ -158,3 +213,64 @@ func registerHandler(register registerFunc, ctx context.Context, mux *runtime.Se
log.Fatalf("Failed to register handler: %v", err)
}
}
// watchConfigmapChanges sets up a listener for configmap changes and calls the onChange function when it happens
func watchConfigmapChanges(client *v1.Client, namespace string, stopCh <-chan struct{}, onChange func(*corev1.ConfigMap) error) {
restClient := client.CoreV1().RESTClient()
resource := "configmaps"
fieldSelector := fields.ParseSelectorOrDie(fmt.Sprintf("metadata.name=%s", "onepanel"))
listFunc := func(options apiv1.ListOptions) (k8runtime.Object, error) {
options.FieldSelector = fieldSelector.String()
req := restClient.Get().
Namespace(namespace).
Resource(resource).
VersionedParams(&options, apiv1.ParameterCodec)
return req.Do().Get()
}
watchFunc := func(options apiv1.ListOptions) (watch.Interface, error) {
options.Watch = true
options.FieldSelector = fieldSelector.String()
req := restClient.Get().
Namespace(namespace).
Resource(resource).
VersionedParams(&options, apiv1.ParameterCodec)
return req.Watch()
}
source := &cache.ListWatch{ListFunc: listFunc, WatchFunc: watchFunc}
_, controller := cache.NewInformer(
source,
&corev1.ConfigMap{},
0,
cache.ResourceEventHandlerFuncs{
UpdateFunc: func(old, new interface{}) {
oldCM := old.(*corev1.ConfigMap)
newCM := new.(*corev1.ConfigMap)
if oldCM.ResourceVersion == newCM.ResourceVersion {
return
}
if newCm, ok := new.(*corev1.ConfigMap); ok {
log.Infof("Detected ConfigMap update.")
if err := onChange(newCm); err != nil {
log.Errorf("Error on calling onChange callback: %v", err)
}
}
},
})
// We don't want the watcher to ever stop, so give it a channel that will never be hit.
neverStopCh := make(chan struct{})
controller.Run(neverStopCh)
}
// customHeaderMatcher is used to allow certain headers so we don't require a grpc-gateway prefix
func customHeaderMatcher(key string) (string, bool) {
lowerCaseKey := strings.ToLower(key)
switch lowerCaseKey {
case "onepanel-auth-token":
return lowerCaseKey, true
case "cookie":
return lowerCaseKey, true
default:
return runtime.DefaultHeaderMatcher(key)
}
}

View File

@@ -1,9 +1,11 @@
package v1
import (
"fmt"
sq "github.com/Masterminds/squirrel"
argoprojv1alpha1 "github.com/argoproj/argo/pkg/client/clientset/versioned/typed/workflow/v1alpha1"
"github.com/jmoiron/sqlx"
"github.com/onepanelio/core/pkg/util/gcs"
"github.com/onepanelio/core/pkg/util/router"
"github.com/onepanelio/core/pkg/util/s3"
log "github.com/sirupsen/logrus"
"k8s.io/client-go/kubernetes"
@@ -13,14 +15,13 @@ import (
type Config = rest.Config
type DB = sqlx.DB
var sb = sq.StatementBuilder.PlaceholderFormat(sq.Dollar)
type Client struct {
kubernetes.Interface
argoprojV1alpha1 argoprojv1alpha1.ArgoprojV1alpha1Interface
*DB
systemConfig SystemConfig
}
func (c *Client) ArgoprojV1alpha1() argoprojv1alpha1.ArgoprojV1alpha1Interface {
@@ -37,7 +38,9 @@ func NewConfig() (config *Config) {
return
}
func NewClient(config *Config, db *sqlx.DB) (client *Client, err error) {
// NewClient creates a client to interact with the Onepanel system.
// It includes access to the database, kubernetes, argo, and configuration.
func NewClient(config *Config, db *DB, systemConfig SystemConfig) (client *Client, err error) {
if config.BearerToken != "" {
config.BearerTokenFile = ""
config.Username = ""
@@ -56,10 +59,16 @@ func NewClient(config *Config, db *sqlx.DB) (client *Client, err error) {
return
}
return &Client{Interface: kubeClient, argoprojV1alpha1: argoClient, DB: db}, nil
return &Client{
Interface: kubeClient,
argoprojV1alpha1: argoClient,
DB: db,
systemConfig: systemConfig,
}, nil
}
func (c *Client) GetS3Client(namespace string, config *ArtifactRepositoryS3Config) (s3Client *s3.Client, err error) {
// GetS3Client initializes a client to Amazon Cloud Storage.
func (c *Client) GetS3Client(namespace string, config *ArtifactRepositoryS3Provider) (s3Client *s3.Client, err error) {
s3Client, err = s3.NewClient(s3.Config{
Endpoint: config.Endpoint,
Region: config.Region,
@@ -75,6 +84,32 @@ func (c *Client) GetS3Client(namespace string, config *ArtifactRepositoryS3Confi
}).Error("getS3Client failed when initializing a new S3 client.")
return
}
return
}
// GetGCSClient initializes a client to Google Cloud Storage.
func (c *Client) GetGCSClient(namespace string, config *ArtifactRepositoryGCSProvider) (gcsClient *gcs.Client, err error) {
return gcs.NewClient(namespace, config.ServiceAccountJSON)
}
// GetWebRouter creates a new web router using the system configuration
func (c *Client) GetWebRouter() (router.Web, error) {
sysConfig, err := c.GetSystemConfig()
if err != nil {
return nil, err
}
fqdn := sysConfig.FQDN()
if fqdn == nil {
return nil, fmt.Errorf("unable to get fqdn")
}
protocol := sysConfig.APIProtocol()
if protocol == nil {
return nil, fmt.Errorf("unable to get protcol")
}
webRouter, err := router.NewWebRouter(*protocol, *fqdn)
return webRouter, err
}

View File

@@ -1,10 +1,18 @@
package v1
import (
"flag"
"fmt"
argoFake "github.com/argoproj/argo/pkg/client/clientset/versioned/fake"
"github.com/jmoiron/sqlx"
"github.com/pressly/goose"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/fake"
"log"
"os"
"testing"
)
var (
@@ -15,6 +23,20 @@ var (
},
}
configArtifactRepository = `archiveLogs: true
s3:
keyFormat: artifacts/{{workflow.namespace}}/{{workflow.name}}/{{pod.name}}
bucket: test.onepanel.io
endpoint: s3.amazonaws.com
insecure: false
region: us-west-2
accessKeySecret:
name: onepanel
key: artifactRepositoryS3AccessKey
secretKeySecret:
name: onepanel
key: artifactRepositoryS3SecretKey`
mockSystemConfigMap = &v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: "onepanel",
@@ -22,6 +44,8 @@ var (
},
Data: map[string]string{
"ONEPANEL_HOST": "demo.onepanel.site",
"ONEPANEL_DOMAIN": "demo.onepanel.site",
"artifactRepository": configArtifactRepository,
"applicationNodePoolLabel": "beta.kubernetes.io/instance-type",
"applicationNodePoolOptions": `
- name: 'CPU: 2, RAM: 8GB'
@@ -34,8 +58,60 @@ var (
`,
},
}
database *sqlx.DB
)
func NewTestClient(objects ...runtime.Object) (client *Client) {
return &Client{Interface: fake.NewSimpleClientset(objects...)}
var flagDatabaseService = flag.String("db", "localhost", "Name to connect to db, defaults to localhost")
func TestMain(m *testing.M) {
// call flag.Parse() here if TestMain uses flags
flag.Parse()
databaseDataSourceName := fmt.Sprintf("host=%v user=%v password=%v dbname=%v sslmode=disable",
*flagDatabaseService, "admin", "tester", "onepanel")
dbDriverName := "postgres"
database = sqlx.MustConnect(dbDriverName, databaseDataSourceName)
// We don't run the go migrations as those setup data that we don't use in our testing
if err := goose.Run("up", database.DB, "../db/sql"); err != nil {
log.Fatalf("Failed to run database migrations: %v", err)
}
os.Exit(m.Run())
}
func NewTestClient(db *sqlx.DB, objects ...runtime.Object) (client *Client) {
k8sFake := fake.NewSimpleClientset(objects...)
argoFakeClient := argoFake.NewSimpleClientset()
return &Client{
Interface: k8sFake,
DB: NewDB(db),
argoprojV1alpha1: argoFakeClient.ArgoprojV1alpha1(),
}
}
func DefaultTestClient() *Client {
return NewTestClient(database, mockSystemConfigMap, mockSystemSecret)
}
func clearDatabase(t *testing.T) {
// We do not delete from goose_db_version as we need it to mark the migrations as ran.
query := `
DELETE FROM labels;
DELETE FROM workspaces;
DELETE FROM workflow_executions;
DELETE FROM cron_workflows;
DELETE FROM workspace_templates;
DELETE FROM workflow_templates;
DELETE FROM workspace_template_versions;
DELETE FROM workflow_template_versions;
`
_, err := database.Exec(query)
if err != nil {
t.Fatal(err)
}
}

View File

@@ -1,6 +1,7 @@
package v1
import (
"fmt"
"github.com/onepanelio/core/pkg/util/ptr"
"gopkg.in/yaml.v2"
)
@@ -16,114 +17,90 @@ type ParameterOption struct {
type Parameter struct {
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
Value *string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
Visibility *string `json:"visibility,omitempty"`
Type string `json:"type,omitempty" protobuf:"bytes,3,opt,name=type"`
DisplayName *string `json:"displayName,omitempty" protobuf:"bytes,4,opt,name=displayName"`
DisplayName *string `json:"displayName,omitempty" yaml:"displayName"`
Hint *string `json:"hint,omitempty" protobuf:"bytes,5,opt,name=hint"`
Options []*ParameterOption `json:"options,omitempty" protobuf:"bytes,6,opt,name=options"`
Required bool `json:"required,omitempty" protobuf:"bytes,7,opt,name=required"`
}
func ParameterFromMap(paramMap map[interface{}]interface{}) *Parameter {
workflowParameter := Parameter{
Options: []*ParameterOption{},
// IsValidParameter returns nil if the parameter is valid or an error otherwise
func IsValidParameter(parameter Parameter) error {
if parameter.Visibility == nil {
return nil
}
// TODO choose a consistent way and use that.
if value, ok := paramMap["displayname"]; ok {
if displayName, ok := value.(string); ok {
workflowParameter.DisplayName = &displayName
}
} else if value, ok := paramMap["displayName"]; ok {
if displayName, ok := value.(string); ok {
workflowParameter.DisplayName = &displayName
}
visibility := *parameter.Visibility
if visibility != "public" && visibility != "protected" && visibility != "internal" && visibility != "private" {
return fmt.Errorf("invalid visibility '%v' for parameter '%v'", visibility, parameter.Name)
}
if value, ok := paramMap["hint"]; ok {
if hint, ok := value.(string); ok {
workflowParameter.Hint = ptr.String(hint)
}
}
if value, ok := paramMap["required"]; ok {
if required, ok := value.(bool); ok {
workflowParameter.Required = required
}
}
if value, ok := paramMap["type"]; ok {
if typeValue, ok := value.(string); ok {
workflowParameter.Type = typeValue
}
}
if value, ok := paramMap["name"]; ok {
if nameValue, ok := value.(string); ok {
workflowParameter.Name = nameValue
}
}
if value, ok := paramMap["value"]; ok {
if valueValue, ok := value.(string); ok {
workflowParameter.Value = &valueValue
}
}
options := paramMap["options"]
optionsArray, ok := options.([]interface{})
if !ok {
return &workflowParameter
}
for _, option := range optionsArray {
optionMap := option.(map[interface{}]interface{})
newOption := ParameterOption{
Name: optionMap["name"].(string),
Value: optionMap["value"].(string),
}
workflowParameter.Options = append(workflowParameter.Options, &newOption)
}
return &workflowParameter
return nil
}
// IsValidParameters returns nil if all parameters are valid or an error otherwise
func IsValidParameters(parameters []Parameter) error {
for _, param := range parameters {
if err := IsValidParameter(param); err != nil {
return err
}
}
return nil
}
// Arguments are the arguments in a manifest file.
type Arguments struct {
Parameters []Parameter `json:"parameters" protobuf:"bytes,1,opt,name=parameters"`
Parameters []Parameter `json:"parameters"`
}
// WorkflowTemplateManifest is a client representation of a WorkflowTemplate
// It is usually provided as YAML by a client and this struct helps to marshal/unmarshal it
type WorkflowTemplateManifest struct {
Arguments Arguments
}
// WorkflowExecutionSpec is a client representation of a WorkflowExecution.
// It is usually provided as YAML by a client and this struct helps to marshal/unmarshal it
// This may be redundant with WorkflowTemplateManifest and should be looked at. # TODO
type WorkflowExecutionSpec struct {
Arguments Arguments
}
// ParseParametersFromManifest takes a manifest and picks out the parameters and returns them as structs
func ParseParametersFromManifest(manifest []byte) ([]Parameter, error) {
var parameters []Parameter
manifestResult := &WorkflowTemplateManifest{
Arguments: Arguments{},
}
mappedData := make(map[string]interface{})
if err := yaml.Unmarshal(manifest, mappedData); err != nil {
err := yaml.Unmarshal(manifest, manifestResult)
if err != nil {
return nil, err
}
arguments, ok := mappedData["arguments"]
if !ok {
return parameters, nil
}
argumentsMap := arguments.(map[interface{}]interface{})
parametersRaw, ok := argumentsMap["parameters"]
if !ok {
return parameters, nil
}
parametersArray, ok := parametersRaw.([]interface{})
for _, parameter := range parametersArray {
paramMap, ok := parameter.(map[interface{}]interface{})
if !ok {
continue
// Default parameter value
for i := range manifestResult.Arguments.Parameters {
parameter := &manifestResult.Arguments.Parameters[i]
if parameter.Visibility == nil {
parameter.Visibility = ptr.String("public")
}
workflowParameter := ParameterFromMap(paramMap)
parameters = append(parameters, *workflowParameter)
}
return parameters, nil
if err := IsValidParameters(manifestResult.Arguments.Parameters); err != nil {
return nil, err
}
return manifestResult.Arguments.Parameters, nil
}
// MapParametersByName returns a map where the parameter name is the key and the parameter is the value
func MapParametersByName(parameters []Parameter) map[string]Parameter {
result := make(map[string]Parameter)
for _, param := range parameters {
result[param.Name] = param
}
return result
}

68
pkg/common_types_test.go Normal file
View File

@@ -0,0 +1,68 @@
package v1
import (
"github.com/stretchr/testify/assert"
"testing"
)
// TestParseParametersFromManifest makes sure that we have correct parsing of parameters from a manifest
func TestParseParametersFromManifest(t *testing.T) {
manifest := `arguments:
parameters:
- name: source
value: https://github.com/onepanelio/Mask_RCNN.git
- name: dataset-path
value: datasets/test_05142020170720
visibility: public
- name: model-path
value: models/rush/cvat6-20
- name: extras
value: none
- name: task-name
value: test
- name: num-classes
value: 2
- name: tf-image
value: tensorflow/tensorflow:1.13.1-py3
- displayName: Node pool
hint: Name of node pool or group
type: select.select
name: sys-node-pool
required: true
options:
- name: 'CPU: 2, RAM: 8GB'
value: Standard_D2s_v3
- name: 'CPU: 4, RAM: 16GB'
value: Standard_D4s_v3
- name: 'GPU: 1xK80, CPU: 6, RAM: 56GB'
value: Standard_NC6
`
parameters, err := ParseParametersFromManifest([]byte(manifest))
assert.Nil(t, err)
assert.NotNil(t, parameters)
assert.Len(t, parameters, 8)
keyedParameters := MapParametersByName(parameters)
// Make sure visibility is set
assert.Equal(t, *keyedParameters["dataset-path"].Visibility, "public")
// Make sure visibility is not set if omitted
assert.Nil(t, keyedParameters["tf-image"].Visibility)
// Make sure numbers, slashes, dashes, and letters are parsed correctly
assert.Equal(t, *keyedParameters["tf-image"].Value, "tensorflow/tensorflow:1.13.1-py3")
// Make sure integers are parsed as strings and not ignored or omitted
assert.Equal(t, *keyedParameters["num-classes"].Value, "2")
// Make sure missing values have a nil value to show they are not there
assert.Nil(t, keyedParameters["sys-node-pool"].Value, nil)
// Make sure options are parsed
assert.Len(t, keyedParameters["sys-node-pool"].Options, 3)
// Make sure string values are correctly parsed
assert.Equal(t, *keyedParameters["extras"].Value, "none")
}

View File

@@ -22,22 +22,42 @@ func (c *Client) getConfigMap(namespace, name string) (configMap *ConfigMap, err
return
}
func (c *Client) GetSystemConfig() (config map[string]string, err error) {
namespace := "onepanel"
configMap, err := c.getConfigMap(namespace, "onepanel")
if err != nil {
return
}
config = configMap.Data
// ClearSystemConfigCache wipes out the cached system configuration so that the next call to
// GetSystemConfig will pull it from the resources
func (c *Client) ClearSystemConfigCache() {
c.systemConfig = nil
}
secret, err := c.GetSecret(namespace, "onepanel")
// GetSystemConfig loads various system configurations and bundles them into a map.
// The configuration is cached once it is loaded, and that cached value is used from here on out.
func (c *Client) GetSystemConfig() (config SystemConfig, err error) {
if c.systemConfig != nil {
return c.systemConfig, nil
}
namespace := "onepanel"
name := "onepanel"
configMap, err := c.getConfigMap(namespace, name)
if err != nil {
return
}
databaseUsername, _ := base64.StdEncoding.DecodeString(secret.Data["databaseUsername"])
config["databaseUsername"] = string(databaseUsername)
databasePassword, _ := base64.StdEncoding.DecodeString(secret.Data["databasePassword"])
config["databasePassword"] = string(databasePassword)
secret, err := c.GetSecret(namespace, name)
if err != nil {
return
}
config, err = NewSystemConfig(configMap, secret)
c.systemConfig = config
return
}
// GetDefaultConfig returns the default configuration of the system
func (c *Client) GetDefaultConfig() (config *ConfigMap, err error) {
config, err = c.getConfigMap("onepanel", "onepanel")
return
}
@@ -52,11 +72,11 @@ func (c *Client) GetNamespaceConfig(namespace string) (config *NamespaceConfig,
return
}
config = &NamespaceConfig{
ArtifactRepository: ArtifactRepositoryConfig{},
ArtifactRepository: ArtifactRepositoryProvider{},
}
err = yaml.Unmarshal([]byte(configMap.Data["artifactRepository"]), &config.ArtifactRepository)
if err != nil || config.ArtifactRepository.S3 == nil {
if err != nil || (config.ArtifactRepository.S3 == nil && config.ArtifactRepository.GCS == nil) {
return nil, util.NewUserError(codes.NotFound, "Artifact repository config not found.")
}
@@ -69,14 +89,22 @@ func (c *Client) GetNamespaceConfig(namespace string) (config *NamespaceConfig,
return
}
// TODO: replace with switch statement to support additional object storage
if config.ArtifactRepository.S3 == nil {
switch {
case config.ArtifactRepository.S3 != nil:
{
accessKey, _ := base64.StdEncoding.DecodeString(secret.Data[config.ArtifactRepository.S3.AccessKeySecret.Key])
config.ArtifactRepository.S3.AccessKey = string(accessKey)
secretKey, _ := base64.StdEncoding.DecodeString(secret.Data[config.ArtifactRepository.S3.SecretKeySecret.Key])
config.ArtifactRepository.S3.Secretkey = string(secretKey)
}
case config.ArtifactRepository.GCS != nil:
{
serviceJSON, _ := base64.StdEncoding.DecodeString(secret.Data[config.ArtifactRepository.GCS.ServiceAccountKeySecret.Key])
config.ArtifactRepository.GCS.ServiceAccountJSON = string(serviceJSON)
}
default:
return nil, util.NewUserError(codes.NotFound, "Artifact repository config not found.")
}
accessKey, _ := base64.StdEncoding.DecodeString(secret.Data[config.ArtifactRepository.S3.AccessKeySecret.Key])
config.ArtifactRepository.S3.AccessKey = string(accessKey)
secretKey, _ := base64.StdEncoding.DecodeString(secret.Data[config.ArtifactRepository.S3.SecretKeySecret.Key])
config.ArtifactRepository.S3.Secretkey = string(secretKey)
return
}

View File

@@ -1,23 +1,322 @@
package v1
import corev1 "k8s.io/api/core/v1"
import (
"encoding/base64"
"fmt"
"strings"
type ArtifactRepositoryS3Config struct {
KeyFormat string
"github.com/onepanelio/core/pkg/util/ptr"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"
corev1 "k8s.io/api/core/v1"
k8yaml "sigs.k8s.io/yaml"
)
// SystemConfig is configuration loaded from kubernetes config and secrets that includes information about the
// database, server, etc.
type SystemConfig map[string]string
// NodePoolOption extends ParameterOption to support resourceRequirements
type NodePoolOption struct {
ParameterOption
Resources corev1.ResourceRequirements
}
// NewSystemConfig creates a System config by getting the required data from a ConfigMap and Secret
func NewSystemConfig(configMap *ConfigMap, secret *Secret) (config SystemConfig, err error) {
config = configMap.Data
databaseUsername, err := base64.StdEncoding.DecodeString(secret.Data["databaseUsername"])
if err != nil {
return
}
config["databaseUsername"] = string(databaseUsername)
databasePassword, err := base64.StdEncoding.DecodeString(secret.Data["databasePassword"])
if err != nil {
return
}
config["databasePassword"] = string(databasePassword)
return
}
// GetValue returns the value in the underlying map if it exists, otherwise nil is returned
// If the value does not exist, it is also logged.
func (s SystemConfig) GetValue(name string) *string {
value, ok := s[name]
if !ok {
log.WithFields(log.Fields{
"Method": "SystemConfig.GetValue",
"Name": name,
"Error": "does not exist",
})
return nil
}
return &value
}
// Domain gets the ONEPANEL_DOMAIN value, or nil.
func (s SystemConfig) Domain() *string {
return s.GetValue("ONEPANEL_DOMAIN")
}
// APIURL gets the ONEPANEL_API_URL, or nil.
func (s SystemConfig) APIURL() *string {
return s.GetValue("ONEPANEL_API_URL")
}
// APIProtocol returns either http:// or https:// or nil.
// It is based on the ONEPANEL_API_URL config value and checks if it has https or http
func (s SystemConfig) APIProtocol() *string {
url := s.APIURL()
if url == nil {
return nil
}
if strings.HasPrefix(*url, "https://") {
return ptr.String("https://")
}
return ptr.String("http://")
}
// FQDN gets the ONEPANEL_FQDN value or nil.
func (s SystemConfig) FQDN() *string {
return s.GetValue("ONEPANEL_FQDN")
}
// NodePoolLabel gets the applicationNodePoolLabel from the config or returns nil.
func (s SystemConfig) NodePoolLabel() (label *string) {
return s.GetValue("applicationNodePoolLabel")
}
// NodePoolOptions loads and parses the applicationNodePoolOptions from the config.
// If there is no data, an error is returned.
func (s SystemConfig) NodePoolOptions() (options []*NodePoolOption, err error) {
data := s.GetValue("applicationNodePoolOptions")
if data == nil {
return nil, fmt.Errorf("no nodePoolOptions in config")
}
if err = k8yaml.Unmarshal([]byte(*data), &options); err != nil {
return
}
return
}
// NodePoolOptionByValue returns the nodePoolOption based on a given value
func (s SystemConfig) NodePoolOptionByValue(value string) (option *NodePoolOption, err error) {
options, err := s.NodePoolOptions()
if err != nil {
return
}
for _, opt := range options {
if opt.Value == value {
option = opt
return
}
}
return
}
// DatabaseDriverName gets the databaseDriverName value, or nil.
func (s SystemConfig) DatabaseDriverName() *string {
return s.GetValue("databaseDriverName")
}
// DatabaseConnection returns system config information to connect to a database
func (s SystemConfig) DatabaseConnection() (driverName, dataSourceName string) {
dataSourceName = fmt.Sprintf("host=%v user=%v password=%v dbname=%v sslmode=disable",
s["databaseHost"], s["databaseUsername"], s["databasePassword"], s["databaseName"])
driverName = *s.DatabaseDriverName()
return
}
// UpdateNodePoolOptions will update the sys-node-pool parameter's options with runtime values
// The original slice is unmodified, the returned slice has the updated values
// If sys-node-pool is not present, nothing happens.
func (s SystemConfig) UpdateNodePoolOptions(parameters []Parameter) ([]Parameter, error) {
result := make([]Parameter, 0)
var nodePoolParameter *Parameter
// Copy the original parameters, skipping sys-node-pool
for i := range parameters {
parameter := parameters[i]
if parameter.Name == "sys-node-pool" {
nodePoolParameter = &parameter
continue
}
result = append(result, parameter)
}
if nodePoolParameter == nil {
return result, nil
}
nodePoolOptions, err := s.NodePoolOptions()
if err != nil {
return result, err
}
options := make([]*ParameterOption, 0)
for _, option := range nodePoolOptions {
newOption := &ParameterOption{
Name: option.Name,
Value: option.Value,
}
options = append(options, newOption)
}
nodePoolParameter.Options = options
result = append(result, *nodePoolParameter)
return result, nil
}
// ArtifactRepositoryS3Provider is meant to be used
// by the CLI. CLI will marshal this struct into the correct
// YAML structure for k8s configmap / secret.
type ArtifactRepositoryS3Provider struct {
KeyFormat string `yaml:"keyFormat"`
Bucket string
Endpoint string
Insecure bool
Region string
AccessKeySecret corev1.SecretKeySelector
SecretKeySecret corev1.SecretKeySelector
AccessKey string
Secretkey string
AccessKeySecret ArtifactRepositorySecret `yaml:"accessKeySecret"`
SecretKeySecret ArtifactRepositorySecret `yaml:"secretKeySecret"`
AccessKey string `yaml:"accessKey,omitempty"`
Secretkey string `yaml:"secretKey,omitempty"`
}
type ArtifactRepositoryConfig struct {
S3 *ArtifactRepositoryS3Config
// ArtifactRepositoryGCSProvider is meant to be used
// by the CLI. CLI will marshal this struct into the correct
// YAML structure for k8s configmap / secret.
type ArtifactRepositoryGCSProvider struct {
KeyFormat string `yaml:"keyFormat"`
Bucket string
Endpoint string
Insecure bool
ServiceAccountKey string `yaml:"serviceAccountKey,omitempty"`
ServiceAccountKeySecret ArtifactRepositorySecret `yaml:"serviceAccountKeySecret"`
ServiceAccountJSON string `yaml:"serviceAccountJSON,omitempty"`
}
// ArtifactRepositoryProvider is used to setup access into AWS Cloud Storage
// or Google Cloud storage.
// - The relevant sub-struct (S3, GCS) is unmarshalled into from the cluster configmap.
// Right now, either the S3 or GCS struct will be filled in. Multiple cloud
// providers are not supported at the same time in params.yaml (manifests deployment).
type ArtifactRepositoryProvider struct {
S3 *ArtifactRepositoryS3Provider `yaml:"s3,omitempty"`
GCS *ArtifactRepositoryGCSProvider `yaml:"gcs,omitempty"`
}
// ArtifactRepositorySecret holds information about a kubernetes Secret.
// - The "key" is the specific key inside the Secret.
// - The "name" is the name of the Secret.
// Usually, this is used to figure out what secret to look into for a specific value.
type ArtifactRepositorySecret struct {
Key string `yaml:"key"`
Name string `yaml:"name"`
}
// MarshalToYaml is used by the CLI to generate configmaps during deployment
// or build operations.
func (a *ArtifactRepositoryS3Provider) MarshalToYaml() (string, error) {
builder := &strings.Builder{}
encoder := yaml.NewEncoder(builder)
encoder.SetIndent(6)
defer encoder.Close()
err := encoder.Encode(&ArtifactRepositoryProvider{
S3: &ArtifactRepositoryS3Provider{
KeyFormat: a.KeyFormat,
Bucket: a.Bucket,
Endpoint: a.Endpoint,
Insecure: a.Insecure,
Region: a.Region,
AccessKeySecret: ArtifactRepositorySecret{
Name: a.AccessKeySecret.Name,
Key: a.AccessKeySecret.Key,
},
SecretKeySecret: ArtifactRepositorySecret{
Name: a.SecretKeySecret.Name,
Key: a.SecretKeySecret.Key,
},
},
})
if err != nil {
return "", err
}
return builder.String(), nil
}
// MarshalToYaml is used by the CLI to generate configmaps during deployment
// or build operations.
func (g *ArtifactRepositoryGCSProvider) MarshalToYaml() (string, error) {
builder := &strings.Builder{}
encoder := yaml.NewEncoder(builder)
encoder.SetIndent(6)
defer encoder.Close()
err := encoder.Encode(&ArtifactRepositoryProvider{
GCS: &ArtifactRepositoryGCSProvider{
KeyFormat: g.KeyFormat,
Bucket: g.Bucket,
Endpoint: g.Endpoint,
Insecure: g.Insecure,
ServiceAccountKeySecret: ArtifactRepositorySecret{
Key: "artifactRepositoryGCSServiceAccountKey",
Name: "onepanel",
},
},
})
if err != nil {
return "", err
}
return builder.String(), nil
}
// FormatKey replaces placeholder values with their actual values and returns this string.
// {{workflow.namespace}} -> namespace
// {{workflow.name}} -> workflowName
// {{pod.name}} -> podName
func (a *ArtifactRepositoryS3Provider) FormatKey(namespace, workflowName, podName string) string {
keyFormat := a.KeyFormat
keyFormat = strings.Replace(keyFormat, "{{workflow.namespace}}", namespace, -1)
keyFormat = strings.Replace(keyFormat, "{{workflow.name}}", workflowName, -1)
keyFormat = strings.Replace(keyFormat, "{{pod.name}}", podName, -1)
return keyFormat
}
// FormatKey replaces placeholder values with their actual values and returns this string.
// {{workflow.namespace}} -> namespace
// {{workflow.name}} -> workflowName
// {{pod.name}} -> podName
func (g *ArtifactRepositoryGCSProvider) FormatKey(namespace, workflowName, podName string) string {
keyFormat := g.KeyFormat
keyFormat = strings.Replace(keyFormat, "{{workflow.namespace}}", namespace, -1)
keyFormat = strings.Replace(keyFormat, "{{workflow.name}}", workflowName, -1)
keyFormat = strings.Replace(keyFormat, "{{pod.name}}", podName, -1)
return keyFormat
}
type NamespaceConfig struct {
ArtifactRepository ArtifactRepositoryConfig
ArtifactRepository ArtifactRepositoryProvider
}

View File

@@ -50,7 +50,7 @@ func (c *Client) UpdateCronWorkflow(namespace string, uid string, cronWorkflow *
})
}
if err := workflowTemplate.UpdateManifestParameters(workflow.Parameters); err != nil {
if err := workflowTemplate.ReplaceManifestParameters(workflow.Parameters); err != nil {
return nil, err
}
@@ -62,10 +62,10 @@ func (c *Client) UpdateCronWorkflow(namespace string, uid string, cronWorkflow *
}
if opts.Labels == nil {
opts.Labels = &map[string]string{}
opts.Labels = map[string]string{}
}
(*opts.Labels)[workflowTemplateUIDLabelKey] = workflowTemplate.UID
(*opts.Labels)[workflowTemplateVersionLabelKey] = fmt.Sprint(workflowTemplate.Version)
opts.Labels[workflowTemplateUIDLabelKey] = workflowTemplate.UID
opts.Labels[workflowTemplateVersionLabelKey] = fmt.Sprint(workflowTemplate.Version)
var argoCronWorkflow wfv1.CronWorkflow
var argoCronWorkflowSpec wfv1.CronWorkflowSpec
if err := argojson.UnmarshalStrict([]byte(rawCronManifest), &argoCronWorkflowSpec); err != nil {
@@ -105,48 +105,17 @@ func (c *Client) UpdateCronWorkflow(namespace string, uid string, cronWorkflow *
// Manifests could get big, don't return them in this case.
cronWorkflow.WorkflowExecution.WorkflowTemplate.Manifest = ""
tx, err := c.DB.Begin()
if err != nil {
return nil, err
}
defer tx.Rollback()
_, err = sb.Update("cron_workflows").
SetMap(sq.Eq{
"manifest": cronWorkflow.Manifest,
}).Where(sq.Eq{
"id": cronWorkflow.ID,
}).
RunWith(tx).
"labels": cronWorkflow.Labels,
}).Where(sq.Eq{"id": cronWorkflow.ID}).
RunWith(c.DB).
Exec()
if err != nil {
return nil, err
}
// delete all labels then replace
_, err = sb.Delete("labels").
Where(sq.Eq{
"resource": TypeCronWorkflow,
"resource_id": cronWorkflow.ID,
}).RunWith(tx).
Exec()
if err != nil {
return nil, err
}
if len(cronWorkflow.Labels) > 0 {
_, err = c.InsertLabelsBuilder(TypeCronWorkflow, cronWorkflow.ID, cronWorkflow.Labels).
RunWith(tx).
Exec()
if err != nil {
return nil, err
}
}
if err := tx.Commit(); err != nil {
return nil, err
}
return cronWorkflow, nil
}
@@ -162,8 +131,10 @@ func (c *Client) CreateCronWorkflow(namespace string, cronWorkflow *CronWorkflow
return nil, util.NewUserError(codes.NotFound, "Error with getting workflow template.")
}
//// TODO: Need to pull system parameters from k8s config/secret here, example: HOST
opts := &WorkflowExecutionOptions{}
// TODO: Need to pull system parameters from k8s config/secret here, example: HOST
opts := &WorkflowExecutionOptions{
Labels: make(map[string]string),
}
opts.GenerateName, err = uid2.GenerateUID(workflowTemplate.Name, 63)
if err != nil {
return nil, err
@@ -176,7 +147,7 @@ func (c *Client) CreateCronWorkflow(namespace string, cronWorkflow *CronWorkflow
})
}
if err := workflowTemplate.UpdateManifestParameters(workflow.Parameters); err != nil {
if err := workflowTemplate.ReplaceManifestParameters(workflow.Parameters); err != nil {
return nil, err
}
@@ -187,12 +158,9 @@ func (c *Client) CreateCronWorkflow(namespace string, cronWorkflow *CronWorkflow
return nil, err
}
if opts.Labels == nil {
opts.Labels = &map[string]string{}
}
(*opts.Labels)[workflowTemplateUIDLabelKey] = workflowTemplate.UID
(*opts.Labels)[workflowTemplateVersionLabelKey] = fmt.Sprint(workflowTemplate.Version)
label.MergeLabelsPrefix(*opts.Labels, workflow.Labels, label.TagPrefix)
opts.Labels[workflowTemplateUIDLabelKey] = workflowTemplate.UID
opts.Labels[workflowTemplateVersionLabelKey] = fmt.Sprint(workflowTemplate.Version)
label.MergeLabelsPrefix(opts.Labels, workflow.Labels, label.TagPrefix)
var argoCronWorkflow wfv1.CronWorkflow
var argoCronWorkflowSpec wfv1.CronWorkflowSpec
@@ -243,52 +211,33 @@ func (c *Client) CreateCronWorkflow(namespace string, cronWorkflow *CronWorkflow
// Manifests could get big, don't return them in this case.
cronWorkflow.WorkflowExecution.WorkflowTemplate.Manifest = ""
tx, err := c.DB.Begin()
if err != nil {
return nil, err
}
defer tx.Rollback()
err = sb.Insert("cron_workflows").
SetMap(sq.Eq{
"uid": cronWorkflow.UID,
"name": cronWorkflow.Name,
"workflow_template_version_id": workflowTemplate.WorkflowTemplateVersionId,
"workflow_template_version_id": workflowTemplate.WorkflowTemplateVersionID,
"manifest": cronWorkflow.Manifest,
"namespace": namespace,
"is_archived": false,
"labels": cronWorkflow.Labels,
}).
Suffix("RETURNING id").
RunWith(tx).
RunWith(c.DB).
QueryRow().
Scan(&cronWorkflow.ID)
if err != nil {
return nil, err
}
if len(cronWorkflow.Labels) > 0 {
_, err = c.InsertLabelsBuilder(TypeCronWorkflow, cronWorkflow.ID, cronWorkflow.Labels).
RunWith(tx).
Exec()
if err != nil {
return nil, err
}
}
if err := tx.Commit(); err != nil {
return nil, err
}
return cronWorkflow, nil
}
// GetCronWorkflow gets information about a cron workflow uniquely identified by a namespace/uid
func (c *Client) GetCronWorkflow(namespace, uid string) (cronWorkflow *CronWorkflow, err error) {
cronWorkflow = &CronWorkflow{}
err = c.cronWorkflowSelectBuilderNoColumns(namespace, uid).
RunWith(c.DB).
QueryRow().
Scan(cronWorkflow)
sb := c.cronWorkflowSelectBuilder(namespace, uid)
err = c.Getx(cronWorkflow, sb)
return
}
@@ -359,40 +308,23 @@ func (c *Client) DeleteCronWorkflowLabel(namespace, name string, keysToDelete ..
return wf.Labels, nil
}
// ListCronWorkflows selects all of the cron workflows for the given namespace and workflow template uid
func (c *Client) ListCronWorkflows(namespace, workflowTemplateUID string, pagination *pagination.PaginationRequest) (cronWorkflows []*CronWorkflow, err error) {
sb := c.cronWorkflowSelectBuilder(namespace, workflowTemplateUID).
OrderBy("cw.created_at DESC")
sb = *pagination.ApplyToSelect(&sb)
query, args, err := sb.ToSql()
if err != nil {
if err := c.DB.Selectx(&cronWorkflows, sb); err != nil {
return nil, err
}
if err := c.DB.Select(&cronWorkflows, query, args...); err != nil {
return nil, err
}
labelsMap, err := c.GetDbLabelsMapped(TypeCronWorkflow, CronWorkflowsToIds(cronWorkflows)...)
if err != nil {
log.WithFields(log.Fields{
"Namespace": namespace,
"Error": err.Error(),
}).Error("Unable to get Workflow Template Labels")
return nil, err
}
for _, resource := range cronWorkflows {
resource.Labels = labelsMap[resource.ID]
}
return
}
func (c *Client) CountCronWorkflows(namespace, workflowTemplateUID string) (count int, err error) {
err = c.cronWorkflowSelectBuilderNoColumns(namespace, workflowTemplateUID).
Columns("COUNT(*)").
RunWith(c.DB.DB).
RunWith(c.DB).
QueryRow().
Scan(&count)
@@ -438,7 +370,7 @@ func (c *Client) buildCronWorkflowDefinition(namespace string, workflowTemplateI
wf.Spec.Arguments.Parameters = newParams
}
if opts.Labels != nil {
cwf.ObjectMeta.Labels = *opts.Labels
cwf.ObjectMeta.Labels = opts.Labels
}
err = injectExitHandlerWorkflowExecutionStatistic(wf, workflowTemplateId)
@@ -461,7 +393,7 @@ func (c *Client) buildCronWorkflowDefinition(namespace string, workflowTemplateI
if mergedLabels == nil {
mergedLabels = make(map[string]string)
}
for k, v := range *opts.Labels {
for k, v := range opts.Labels {
mergedLabels[k] = v
}
cwf.Spec.WorkflowMetadata.Labels = mergedLabels
@@ -526,7 +458,7 @@ func (c *Client) TerminateCronWorkflow(namespace, uid string) (err error) {
//workflow executions
var workflows []*WorkflowExecution
query, args, err := sb.Select().
Columns(getWorkflowExecutionColumns("we", "")...).
Columns(getWorkflowExecutionColumns("we")...).
From("workflow_executions we").
Where(sq.Eq{
"cron_workflow_id": cronWorkflow.ID,
@@ -580,19 +512,20 @@ func (c *Client) ArchiveCronWorkflow(namespace, uid string) (err error) {
func (c *Client) cronWorkflowSelectBuilder(namespace string, workflowTemplateUid string) sq.SelectBuilder {
sb := c.cronWorkflowSelectBuilderNoColumns(namespace, workflowTemplateUid).
Columns(getCronWorkflowColumns("wtv.version")...)
Columns(getCronWorkflowColumns("cw")...).
Columns("wtv.version")
return sb
}
func (c *Client) cronWorkflowSelectBuilderNoColumns(namespace string, workflowTemplateUid string) sq.SelectBuilder {
func (c *Client) cronWorkflowSelectBuilderNoColumns(namespace string, workflowTemplateUID string) sq.SelectBuilder {
sb := sb.Select().
From("cron_workflows cw").
Join("workflow_template_versions wtv ON wtv.id = cw.workflow_template_version_id").
Join("workflow_templates wt ON wt.id = wtv.workflow_template_id").
Where(sq.Eq{
"wt.namespace": namespace,
"wt.uid": workflowTemplateUid,
"wt.uid": workflowTemplateUID,
"cw.is_archived": false,
})
@@ -662,8 +595,8 @@ func (c *Client) GetCronWorkflowStatisticsForTemplates(workflowTemplates ...*Wor
return
}
func (c *Client) selectCronWorkflowWithWorkflowTemplateVersion(namespace, uid string, extraColumns ...string) (*CronWorkflow, error) {
query, args, err := sb.Select(getCronWorkflowColumns(extraColumns...)...).
func (c *Client) selectCronWorkflowWithWorkflowTemplateVersion(namespace, uid string) (*CronWorkflow, error) {
query, args, err := sb.Select(getCronWorkflowColumns("cw")...).
From("cron_workflows cw").
Join("workflow_template_versions wtv ON wtv.id = cw.workflow_template_version_id").
Join("workflow_templates wt ON wt.id = wtv.workflow_template_id").

107
pkg/cron_workflow_types.go Normal file
View File

@@ -0,0 +1,107 @@
package v1
import (
"encoding/json"
"github.com/onepanelio/core/pkg/util/mapping"
"github.com/onepanelio/core/pkg/util/types"
"github.com/onepanelio/core/util/sql"
"gopkg.in/yaml.v2"
"time"
)
// CronWorkflow represents a workflow that runs on a cron.
type CronWorkflow struct {
ID uint64
CreatedAt time.Time `db:"created_at"`
ModifiedAt *time.Time `db:"modified_at"`
UID string
Name string
GenerateName string
WorkflowExecution *WorkflowExecution
Labels types.JSONLabels
Version int64
WorkflowTemplateVersionID uint64 `db:"workflow_template_version_id"`
Manifest string
Namespace string `db:"namespace"`
}
// CronWorkflowManifest is a client representation of a CronWorkflowManifest
// It is usually provided as YAML by a client and this struct helps to marshal/unmarshal it
type CronWorkflowManifest struct {
WorkflowExecutionSpec WorkflowExecutionSpec `json:"workflowSpec" yaml:"workflowSpec"`
}
// GetParametersFromWorkflowSpec parses the parameters from the CronWorkflow's manifest
func (cw *CronWorkflow) GetParametersFromWorkflowSpec() ([]Parameter, error) {
manifestSpec := &CronWorkflowManifest{}
if err := yaml.Unmarshal([]byte(cw.Manifest), manifestSpec); err != nil {
return nil, err
}
parameters := manifestSpec.WorkflowExecutionSpec.Arguments.Parameters
return parameters, nil
}
// GetParametersFromWorkflowSpecJSON parses the parameters from the CronWorkflow's manifest and returns them as a JSON string
func (cw *CronWorkflow) GetParametersFromWorkflowSpecJSON() ([]byte, error) {
parameters, err := cw.GetParametersFromWorkflowSpec()
if err != nil {
return nil, err
}
parametersJSON, err := json.Marshal(parameters)
if err != nil {
return nil, err
}
return parametersJSON, nil
}
// AddToManifestSpec updates the CronWorkflow's manifest by setting the input manifest under the specified key
func (cw *CronWorkflow) AddToManifestSpec(key, manifest string) error {
currentManifestMapping, err := mapping.NewFromYamlString(cw.Manifest)
if err != nil {
return err
}
additionalManifest, err := mapping.NewFromYamlString(manifest)
if err != nil {
return err
}
currentManifestMapping[key] = additionalManifest
updatedManifest, err := currentManifestMapping.ToYamlBytes()
if err != nil {
return err
}
cw.Manifest = string(updatedManifest)
return nil
}
// getCronWorkflowColumns returns all of the columns for cronWorkflow modified by alias, destination.
// see formatColumnSelect
func getCronWorkflowColumns(aliasAndDestination ...string) []string {
columns := []string{"id", "created_at", "uid", "name", "workflow_template_version_id", "manifest", "namespace", "labels"}
return sql.FormatColumnSelect(columns, aliasAndDestination...)
}
// CronWorkflowsToIDs returns an array of ids from the input CronWorkflow with no duplicates.
func CronWorkflowsToIDs(resources []*CronWorkflow) (ids []uint64) {
mappedIds := make(map[uint64]bool)
// This is to make sure we don't have duplicates
for _, resource := range resources {
mappedIds[resource.ID] = true
}
for id := range mappedIds {
ids = append(ids, id)
}
return
}

View File

@@ -0,0 +1,113 @@
package v1
import (
"github.com/stretchr/testify/assert"
"testing"
)
// TestCronWorkflow_GetParametersFromWorkflowSpec makes sure the GetParametersFromWorkflowSpec method works
func TestCronWorkflow_GetParametersFromWorkflowSpec(t *testing.T) {
manifest := `concurrencyPolicy: Allow
failedJobsHistoryLimit: 1
schedule: '* * * * 2'
startingDeadlineSeconds: 0
successfulJobsHistoryLimit: 3
suspend: false
timezone: Etc/UTC
workflowSpec:
arguments:
parameters:
- displayname: ""
hint: ""
name: source
options: []
required: false
type: ""
value: https://github.com/onepanelio/Mask_RCNN.git
- displayname: ""
hint: ""
name: dataset-path
options: []
required: false
type: ""
value: datasets/test_05142020170720
- displayname: ""
hint: ""
name: model-path
options: []
required: false
type: ""
value: models/rush/cvat6-20
- displayname: ""
hint: ""
name: extras
options: []
required: false
type: ""
value: none
- displayname: ""
hint: ""
name: task-name
options: []
required: false
type: ""
value: test
- displayname: ""
hint: ""
name: num-classes
options: []
required: false
type: ""
value: "2"
- displayname: ""
hint: ""
name: stage-1-epochs
options: []
required: false
type: ""
value: "1"
- displayname: ""
hint: ""
name: stage-2-epochs
options: []
required: false
type: ""
value: "2"
- displayname: ""
hint: ""
name: stage-3-epochs
options: []
required: false
type: ""
value: "3"
- displayname: ""
hint: ""
name: tf-image
options: []
required: false
type: ""
value: tensorflow/tensorflow:1.13.1-py3
- displayname: Node pool
hint: Name of node pool or group
name: sys-node-pool
options:
- name: 'CPU: 2, RAM: 8GB'
value: Standard_D2s_v3
- name: 'CPU: 4, RAM: 16GB'
value: Standard_D4s_v3
- name: 'GPU: 1xK80, CPU: 6, RAM: 56GB'
value: Standard_NC6
required: true
type: select.select
value: cake`
cronWorkflow := CronWorkflow{
Manifest: manifest,
}
parameters, err := cronWorkflow.GetParametersFromWorkflowSpec()
assert.Nil(t, err)
assert.NotNil(t, parameters)
assert.Len(t, parameters, 11)
}

42
pkg/database.go Normal file
View File

@@ -0,0 +1,42 @@
package v1
import (
sq "github.com/Masterminds/squirrel"
"github.com/jmoiron/sqlx"
)
// DB represents a database connection. It wraps a sqlx.DB to provide convenience methods.
type DB struct {
sqlx.DB
}
// NewDB creates a new DB using an existing sqlx.DB connection.
func NewDB(db *sqlx.DB) *DB {
return &DB{
*db,
}
}
// Selectx performs a select query using a squirrel SelectBuilder as an argument.
//
// This is a convenience wrapper. Any errors from squirrel or sqlx are returned as is.
func (db *DB) Selectx(dest interface{}, builder sq.SelectBuilder) error {
sql, args, err := builder.ToSql()
if err != nil {
return err
}
return db.Select(dest, sql, args...)
}
// Getx performs a get query using a squirrel SelectBuilder as an argument.
//
// This is a convenience wrapper. Any errors from squirrel or sqlx are returned as is.
func (db *DB) Getx(dest interface{}, builder sq.SelectBuilder) error {
query, args, err := builder.ToSql()
if err != nil {
return err
}
return db.Get(dest, query, args...)
}

73
pkg/file_types.go Normal file
View File

@@ -0,0 +1,73 @@
package v1
import (
"strings"
"time"
)
// File represents a system file.
type File struct {
Path string
Name string
Size int64
Extension string
ContentType string
LastModified time.Time
Directory bool
}
// FilePathToParentPath given a path, returns the parent path, assuming a '/' delimiter
// Result does not have a trailing slash.
// -> a/b/c/d would return a/b/c
// -> a/b/c/d/ would return a/b/c
// If path is empty string, it is returned.
// If path is '/' (root) it is returned as is.
// If there is no '/', '/' is returned.
func FilePathToParentPath(path string) string {
separator := "/"
if path == "" || path == separator {
return path
}
if strings.HasSuffix(path, "/") {
path = path[0 : len(path)-1]
}
lastIndexOfForwardSlash := strings.LastIndex(path, separator)
if lastIndexOfForwardSlash <= 0 {
return separator
}
return path[0:lastIndexOfForwardSlash]
}
// FilePathToExtension returns the file's extension if it uses a dot "." to denote it.
// otherwise it returns the text following the last dot in the path.
func FilePathToExtension(path string) string {
dotIndex := strings.LastIndex(path, ".")
if dotIndex == -1 {
return ""
}
if dotIndex == (len(path) - 1) {
return ""
}
return path[dotIndex+1:]
}
// FilePathToName returns the name of the file, assuming that "/" denote directories and that the
// file name is after the last "/"
func FilePathToName(path string) string {
if strings.HasSuffix(path, "/") {
path = path[:len(path)-1]
}
lastSlashIndex := strings.LastIndex(path, "/")
if lastSlashIndex < 0 {
return path
}
return path[lastSlashIndex+1:]
}

112
pkg/label_types.go Normal file
View File

@@ -0,0 +1,112 @@
package v1
import (
"encoding/json"
"fmt"
"strings"
"time"
)
// Label represents a database-backed label row.
type Label struct {
ID uint64
CreatedAt time.Time `db:"created_at"`
Key string
Value string
Resource string
ResourceID uint64 `db:"resource_id"`
}
// LabelsToMapping converts Label structs to a map of key:value
func LabelsToMapping(labels ...*Label) map[string]string {
result := make(map[string]string)
for _, label := range labels {
result[label.Key] = label.Value
}
return result
}
// LabelsFromString parses a string into labels
// Format: key=<key>,value=<value>&key2=<key2>,value2=<value2>
func LabelsFromString(value string) (labels []*Label, err error) {
labels = make([]*Label, 0)
if value == "" {
return
}
labelParts := strings.Split(value, "&")
if len(labelParts) == 0 {
return
}
for _, part := range labelParts {
if part == "" {
continue
}
newLabel, err := LabelFromString(part)
if err != nil {
return labels, err
}
if newLabel == nil {
continue
}
labels = append(labels, newLabel)
}
return
}
// LabelFromString converts a parses into a label
// Format: key=<key>,value=<value>
func LabelFromString(value string) (label *Label, err error) {
parts := strings.Split(value, ",")
if len(parts) != 2 {
return nil, fmt.Errorf("label does not have two parts, key/value")
}
label = &Label{}
first := parts[0]
firstItems := strings.Split(first, "=")
if len(firstItems) != 2 {
return nil, fmt.Errorf(`incorrectly formatted label "%v"`, first)
}
if firstItems[0] == "key" {
label.Key = firstItems[1]
} else if firstItems[0] == "value" {
label.Value = firstItems[1]
}
second := parts[1]
secondItems := strings.Split(second, "=")
if len(secondItems) != 2 {
return nil, fmt.Errorf(`incorrectly formatted label "%v"`, second)
}
if secondItems[0] == "key" {
label.Key = secondItems[1]
} else if secondItems[0] == "value" {
label.Value = secondItems[1]
}
return label, nil
}
// LabelsToJSONString converts an array of labels to a json string representing an object
// where the keys are the label keys and the values are the label values
func LabelsToJSONString(labels []*Label) (string, error) {
labelMap := LabelsToMapping(labels...)
resultBytes, err := json.Marshal(labelMap)
if err != nil {
return "", err
}
return string(resultBytes), nil
}

60
pkg/label_types_test.go Normal file
View File

@@ -0,0 +1,60 @@
package v1
import (
"testing"
"github.com/stretchr/testify/assert"
)
// TestLabelFromString tests the LabelFromString function
func TestLabelFromString(t *testing.T) {
// Blank value gives us no label
label, err := LabelFromString("")
assert.NotNil(t, err)
assert.Nil(t, label)
// Missing value, should give error
label, err = LabelFromString("key=a")
assert.NotNil(t, err)
// Missing value, but still have comma, should give error
label, err = LabelFromString("key=a,")
assert.NotNil(t, err)
// Missing key, should give error
label, err = LabelFromString("value=a")
assert.NotNil(t, err)
// Missing key, still have comma, should give error
label, err = LabelFromString("value=a,")
assert.NotNil(t, err)
// Correct, should not give an error
label, err = LabelFromString("key=a,value=b")
assert.Nil(t, err)
assert.Equal(t, label.Key, "a")
assert.Equal(t, label.Value, "b")
}
// TestLabelsFromString tests the LabelsFromString function
func TestLabelsFromString(t *testing.T) {
// Empty should give no error and no labels
labels, err := LabelsFromString("")
assert.Nil(t, err)
assert.Len(t, labels, 0)
// Bad data, should give no labels
labels, err = LabelsFromString("&&&&")
assert.Nil(t, err)
assert.Len(t, labels, 0)
// Test just one label
labels, err = LabelsFromString("key=a,value=b")
assert.Nil(t, err)
assert.Len(t, labels, 1)
// Test many labels
labels, err = LabelsFromString("key=a,value=b&key=c,value=d&key=e,value=f")
assert.Nil(t, err)
assert.Len(t, labels, 3)
}

View File

@@ -1,96 +1,55 @@
package v1
import (
"database/sql"
"fmt"
sq "github.com/Masterminds/squirrel"
"github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
"github.com/onepanelio/core/pkg/util/label"
"github.com/onepanelio/core/pkg/util/mapping"
"github.com/onepanelio/core/pkg/util/types"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func (c *Client) ListLabels(resource string, uid string) (labels []*Label, err error) {
sb := sb.Select("l.id", "l.created_at", "l.key", "l.value", "l.resource", "l.resource_id").
From("labels l").
Where(sq.Eq{
"resource": resource,
}).
OrderBy("l.created_at")
sb := sb.Select("labels").
From(TypeToTableName(resource))
switch resource {
case TypeWorkflowTemplate:
sb = sb.Join("workflow_templates wt ON wt.id = l.resource_id").
Where(sq.Eq{"wt.uid": uid})
case TypeWorkflowTemplateVersion:
sb = sb.Join("workflow_template_versions wtv ON wtv.id = l.resource_id").
Where(sq.Eq{"wtv.uid": uid})
sb = sb.Where(sq.Eq{"uid": uid})
case TypeWorkflowExecution:
sb = sb.Join("workflow_executions we ON we.id = l.resource_id").
Where(sq.Eq{"we.uid": uid})
sb = sb.Where(sq.Eq{"uid": uid})
case TypeCronWorkflow:
sb = sb.Join("cron_workflows cw ON cw.id = l.resource_id").
Where(sq.Eq{"cw.uid": uid})
sb = sb.Where(sq.Eq{"uid": uid})
case TypeWorkspace:
sb = sb.Where(sq.And{
sq.Eq{"uid": uid},
sq.NotEq{"phase": "Terminated"},
})
default:
return nil, fmt.Errorf("unsupported label resource %v", resource)
}
query, args, sqlErr := sb.ToSql()
if sqlErr != nil {
err = sqlErr
result := types.JSONLabels{}
err = c.DB.Getx(&result, sb)
if err != nil {
return
}
err = c.DB.Select(&labels, query, args...)
for key, value := range result {
newLabel := &Label{
Key: key,
Value: value,
Resource: resource,
}
labels = append(labels, newLabel)
}
return
}
func (c *Client) AddLabels(namespace, resource, uid string, keyValues map[string]string) error {
tx, err := c.DB.Begin()
if err != nil {
return err
}
defer tx.Rollback()
tableName := TypeToTableName(resource)
if tableName == "" {
return fmt.Errorf("unknown resources '%v'", resource)
}
resourceId := uint64(0)
err = sb.Select("id").
From(tableName).
Where(sq.Eq{
"uid": uid,
}).
RunWith(tx).
QueryRow().
Scan(&resourceId)
if err != nil {
return err
}
_, err = sb.Delete("labels").
Where(sq.Eq{
"key": mapping.PluckKeysStr(keyValues),
"resource": resource,
"resource_id": resourceId,
}).RunWith(tx).
Exec()
if err != nil {
return err
}
_, err = c.InsertLabelsBuilder(resource, resourceId, keyValues).
RunWith(tx).
Exec()
if err != nil {
return err
}
if err := tx.Commit(); err != nil {
return err
}
source, meta, err := c.GetK8sLabelResource(namespace, resource, uid)
if err != nil {
return err
@@ -119,51 +78,41 @@ func (c *Client) ReplaceLabels(namespace, resource, uid string, keyValues map[st
return fmt.Errorf("unknown resources '%v'", resource)
}
resourceID := uint64(0)
err = sb.Select("id").
From(tableName).
Where(sq.Eq{
"uid": uid,
var whereCondition interface{} = nil
if resource == TypeWorkspace {
whereCondition = sq.And{
sq.Eq{"uid": uid},
sq.NotEq{"phase": "Terminated"},
}
} else if resource == TypeWorkspaceTemplate || resource == TypeWorkflowExecution {
whereCondition =
sq.Eq{
"uid": uid,
"is_archived": false,
}
}
_, err = sb.Update(tableName).
SetMap(sq.Eq{
"labels": types.JSONLabels(keyValues),
}).
Where(whereCondition).
RunWith(tx).
QueryRow().
Scan(&resourceID)
if err != nil {
return err
}
return c.ReplaceLabelsUsingKnownID(namespace, resource, resourceID, uid, keyValues)
}
func (c *Client) ReplaceLabelsUsingKnownID(namespace, resource string, resourceID uint64, uid string, keyValues map[string]string) error {
tx, err := c.DB.Begin()
if err != nil {
return err
}
defer tx.Rollback()
_, err = sb.Delete("labels").
Where(sq.Eq{
"resource": resource,
"resource_id": resourceID,
}).RunWith(tx).
Exec()
if err != nil {
return err
}
if len(keyValues) > 0 {
_, err = c.InsertLabelsBuilder(resource, resourceID, keyValues).
RunWith(tx).
Exec()
if err != nil {
return err
}
}
if err := tx.Commit(); err != nil {
return err
}
return c.ReplaceLabelsUsingKnownID(namespace, resource, uid, keyValues)
}
// ReplaceLabelsUsingKnownID updates the k8s resource labels for the given resource/uid
// deprecated
func (c *Client) ReplaceLabelsUsingKnownID(namespace, resource string, uid string, keyValues map[string]string) error {
source, meta, err := c.GetK8sLabelResource(namespace, resource, uid)
if err != nil {
return err
@@ -244,80 +193,22 @@ func (c *Client) DeleteLabels(namespace, resource, uid string, keyValues map[str
return nil
}
func (c *Client) InsertLabelsBuilder(resource string, resourceID uint64, keyValues map[string]string) sq.InsertBuilder {
sb := sb.Insert("labels").
Columns("resource", "resource_id", "key", "value")
for key, value := range keyValues {
sb = sb.Values(resource, resourceID, key, value)
// DeleteResourceLabels deletes all of the labels for a specific resource, like workflow templates.
// NOTE: this does NOT delete k8s labels, and is only meant to be used for special cases.
func (c *Client) DeleteResourceLabels(runner sq.BaseRunner, resource string) error {
tableName := TypeToTableName(resource)
if tableName == "" {
return fmt.Errorf("unknown resources '%v'", resource)
}
return sb
}
// Inserts the labels for the resource. If no labels are provided, does nothing and returns nil, nil.
func (c *Client) InsertLabels(resource string, resourceID uint64, keyValues map[string]string) (sql.Result, error) {
if len(keyValues) == 0 {
return nil, nil
}
return c.InsertLabelsBuilder(resource, resourceID, keyValues).
RunWith(c.DB).
Exec()
}
func (c *Client) GetDbLabels(resource string, ids ...uint64) (labels []*Label, err error) {
if len(ids) == 0 {
return make([]*Label, 0), nil
}
tx, err := c.DB.Begin()
if err != nil {
return nil, err
}
defer tx.Rollback()
query, args, err := sb.Select("id", "created_at", "key", "value", "resource", "resource_id").
From("labels").
_, err := sb.Delete("labels").
Where(sq.Eq{
"resource_id": ids,
"resource": resource,
"resource": resource,
}).
OrderBy("key").
ToSql()
RunWith(runner).
Exec()
if err != nil {
return nil, err
}
err = c.DB.Select(&labels, query, args...)
if err != nil {
return nil, err
}
return
}
// TODO rename Db to be DB per go conventions
// Returns a map where the key is the id of the resource
// and the value is the labels as a map[string]string
func (c *Client) GetDbLabelsMapped(resource string, ids ...uint64) (result map[uint64]map[string]string, err error) {
dbLabels, err := c.GetDbLabels(resource, ids...)
if err != nil {
return
}
result = make(map[uint64]map[string]string)
for _, dbLabel := range dbLabels {
_, ok := result[dbLabel.ResourceId]
if !ok {
result[dbLabel.ResourceId] = make(map[string]string)
}
result[dbLabel.ResourceId][dbLabel.Key] = dbLabel.Value
}
return
return err
}
func (c *Client) GetK8sLabelResource(namespace, resource, uid string) (source interface{}, result *v1.ObjectMeta, err error) {

View File

@@ -21,8 +21,9 @@ func testCreateNamespace(c *Client) {
})
}
}
func TestListNamespace(t *testing.T) {
c := NewTestClient()
func TestClient_ListNamespace(t *testing.T) {
c := DefaultTestClient()
testCreateNamespace(c)

View File

@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert"
)
func TestCreateSecret(t *testing.T) {
c := NewTestClient()
func TestClient_CreateSecret(t *testing.T) {
c := DefaultTestClient()
err := c.CreateSecret("namespace", &Secret{
Name: "name",
@@ -15,8 +15,8 @@ func TestCreateSecret(t *testing.T) {
assert.Nil(t, err)
}
func TestGetSecret(t *testing.T) {
c := NewTestClient()
func TestClient_GetSecret(t *testing.T) {
c := DefaultTestClient()
err := c.CreateSecret("namespace", &Secret{
Name: "name",

87
pkg/service.go Normal file
View File

@@ -0,0 +1,87 @@
package v1
import (
"fmt"
)
// generateServiceURL generates the url that the service is located at
func (c *Client) generateServiceURL(namespace, name string) (string, error) {
protocol := c.systemConfig.APIProtocol()
if protocol == nil {
return "", fmt.Errorf("unable to get the api protocol from the system config")
}
domain := c.systemConfig.Domain()
if domain == nil {
return "", fmt.Errorf("unable to get a domain from the system config")
}
// https://name--namespace.domain
return fmt.Sprintf("%v%v--%v.%v", *protocol, name, namespace, *domain), nil
}
// ListServices finds all of the services in the given namespace
func (c *Client) ListServices(namespace string) ([]*Service, error) {
if namespace == "" {
return nil, fmt.Errorf("namespace is empty")
}
labelSelect := fmt.Sprintf("%v=%v", "service.onepanel.io/part-of", "onepanel")
serviceList, err := c.CoreV1().Services(namespace).List(ListOptions{
LabelSelector: labelSelect,
})
if err != nil {
return nil, err
}
services := make([]*Service, 0)
for _, serviceItem := range serviceList.Items {
serviceName := serviceItem.Labels["service.onepanel.io/name"]
serviceURL, err := c.generateServiceURL(namespace, serviceName)
if err != nil {
return nil, err
}
services = append(services, &Service{
Name: serviceName,
URL: serviceURL,
})
}
return services, nil
}
// GetService gets a specific service identified by namespace, name.
// If it is not found, nil, nil is returned
func (c *Client) GetService(namespace, name string) (*Service, error) {
labelSelect := fmt.Sprintf("%v=%v,%v=%v", "service.onepanel.io/part-of", "onepanel", "service.onepanel.io/name", name)
serviceList, err := c.CoreV1().Services(namespace).List(ListOptions{
LabelSelector: labelSelect,
})
if err != nil {
return nil, err
}
if len(serviceList.Items) == 0 {
return nil, nil
}
if len(serviceList.Items) > 1 {
return nil, fmt.Errorf("non-unique result found for GetService %v,%v", namespace, name)
}
serviceItem := serviceList.Items[0]
serviceName := serviceItem.Labels["service.onepanel.io/name"]
serviceURL, err := c.generateServiceURL(namespace, serviceName)
if err != nil {
return nil, err
}
service := &Service{
Name: serviceName,
URL: serviceURL,
}
return service, nil
}

8
pkg/service_types.go Normal file
View File

@@ -0,0 +1,8 @@
package v1
// Service represents an installable "service" added to the system.
// This can be something like modeldb, or some other service that complements the main system.
type Service struct {
Name string
URL string
}

View File

@@ -1,12 +1,6 @@
package v1
import (
"encoding/json"
"fmt"
"github.com/onepanelio/core/pkg/util/mapping"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
"strings"
"time"
wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
@@ -70,131 +64,6 @@ type Metric struct {
Format string `json:"omitempty"`
}
type CronWorkflow struct {
ID uint64
CreatedAt time.Time `db:"created_at"`
ModifiedAt *time.Time `db:"modified_at"`
UID string
Name string
GenerateName string
WorkflowExecution *WorkflowExecution
Labels map[string]string
Version int64
WorkflowTemplateVersionId uint64 `db:"workflow_template_version_id"`
Manifest string
Namespace string `db:"namespace"`
}
func (cw *CronWorkflow) GetParametersFromWorkflowSpec() ([]Parameter, error) {
var parameters []Parameter
mappedData := make(map[string]interface{})
if err := yaml.Unmarshal([]byte(cw.Manifest), mappedData); err != nil {
return nil, err
}
workflowSpec, ok := mappedData["workflowSpec"]
if !ok {
return parameters, nil
}
workflowSpecMap := workflowSpec.(map[interface{}]interface{})
arguments, ok := workflowSpecMap["arguments"]
if !ok {
return parameters, nil
}
argumentsMap := arguments.(map[interface{}]interface{})
parametersRaw, ok := argumentsMap["parameters"]
if !ok {
return parameters, nil
}
parametersArray, ok := parametersRaw.([]interface{})
for _, parameter := range parametersArray {
paramMap, ok := parameter.(map[interface{}]interface{})
if !ok {
continue
}
workflowParameter := ParameterFromMap(paramMap)
parameters = append(parameters, *workflowParameter)
}
return parameters, nil
}
func (cw *CronWorkflow) GetParametersFromWorkflowSpecJson() ([]byte, error) {
parameters, err := cw.GetParametersFromWorkflowSpec()
if err != nil {
return nil, err
}
parametersJson, err := json.Marshal(parameters)
if err != nil {
return nil, err
}
return parametersJson, nil
}
func (cw *CronWorkflow) AddToManifestSpec(key, manifest string) error {
currentManifestMapping, err := mapping.NewFromYamlString(cw.Manifest)
if err != nil {
return err
}
additionalManifest, err := mapping.NewFromYamlString(manifest)
if err != nil {
return err
}
currentManifestMapping[key] = additionalManifest
updatedManifest, err := currentManifestMapping.ToYamlBytes()
if err != nil {
return err
}
cw.Manifest = string(updatedManifest)
return nil
}
type WorkflowTemplate struct {
ID uint64
CreatedAt time.Time `db:"created_at"`
ModifiedAt *time.Time `db:"modified_at"`
UID string
Namespace string
Name string
Manifest string
Version int64 // The latest version, unix timestamp
Versions int64 `db:"versions"` // How many versions there are of this template total.
IsLatest bool
IsArchived bool `db:"is_archived"`
IsSystem bool `db:"is_system"`
ArgoWorkflowTemplate *wfv1.WorkflowTemplate
Labels map[string]string
WorkflowExecutionStatisticReport *WorkflowExecutionStatisticReport
CronWorkflowsStatisticsReport *CronWorkflowStatisticReport
// todo rename to have ID suffix
WorkflowTemplateVersionId uint64 `db:"workflow_template_version_id"` // Reference to the associated workflow template version.
Resource *string // utility in case we are specifying a workflow template for a specific resource
ResourceUID *string // see Resource field
}
type Label struct {
ID uint64
CreatedAt time.Time `db:"created_at"`
Key string
Value string
Resource string
ResourceId uint64 `db:"resource_id"`
}
type WorkflowExecutionStatisticReport struct {
WorkflowTemplateId uint64 `db:"workflow_template_id"`
Total int32
@@ -210,355 +79,10 @@ type CronWorkflowStatisticReport struct {
Total int32
}
type WorkflowTemplateVersion struct {
ID uint64
UID string
Version int64
IsLatest bool `db:"is_latest"`
Manifest string
CreatedAt time.Time `db:"created_at"`
WorkflowTemplate *WorkflowTemplate `db:"workflow_template"`
Labels map[string]string
}
type WorkflowExecutionStatistic struct {
ID uint64
WorkflowTemplateId uint64
Name string
Namespace string
//Interface to support null values for timestamps, when scanning from db into structs
CreatedAt *time.Time `db:"created_at"`
FinishedAt *time.Time `db:"finished_at"`
FailedAt *time.Time `db:"failed_at"`
}
func (wt *WorkflowTemplate) GetManifestBytes() []byte {
return []byte(wt.Manifest)
}
func (wt *WorkflowTemplate) GetParametersKeyString() (map[string]string, error) {
root := make(map[interface{}]interface{})
if err := yaml.Unmarshal(wt.GetManifestBytes(), root); err != nil {
return nil, err
}
arguments, ok := root["arguments"]
if !ok {
return nil, nil
}
argumentsMap, ok := arguments.(map[interface{}]interface{})
if !ok {
return nil, nil
}
parameters, ok := argumentsMap["parameters"]
if !ok {
return nil, nil
}
parametersAsArray, ok := parameters.([]interface{})
if !ok {
return nil, nil
}
if len(parametersAsArray) == 0 {
delete(root, arguments)
}
result := make(map[string]string)
for index, parameter := range parametersAsArray {
parameterMap, ok := parameter.(map[interface{}]interface{})
if !ok {
continue
}
key := parameterMap["name"]
keyAsString, ok := key.(string)
if !ok {
continue
}
parameterMap["order"] = index
remainingParameters, err := yaml.Marshal(parameterMap)
if err != nil {
continue
}
result[keyAsString] = string(remainingParameters)
}
return result, nil
}
func (wt *WorkflowTemplate) UpdateManifestParameters(params []Parameter) error {
manifestMap, err := mapping.NewFromYamlString(wt.Manifest)
if err != nil {
return err
}
arguments, err := manifestMap.GetChildMap("arguments")
if err != nil {
return err
}
arguments["parameters"] = params
manifestBytes, err := manifestMap.ToYamlBytes()
if err != nil {
return err
}
wt.Manifest = string(manifestBytes)
return nil
}
func (wt *WorkflowTemplate) GetWorkflowManifestBytes() ([]byte, error) {
if wt.ArgoWorkflowTemplate == nil {
return []byte{}, nil
}
wt.ArgoWorkflowTemplate.TypeMeta.Kind = "Workflow"
wt.ArgoWorkflowTemplate.ObjectMeta = metav1.ObjectMeta{
GenerateName: wt.ArgoWorkflowTemplate.ObjectMeta.GenerateName,
Labels: wt.ArgoWorkflowTemplate.ObjectMeta.Labels,
}
return json.Marshal(wt.ArgoWorkflowTemplate)
}
func (wt *WorkflowTemplate) FormatManifest() (string, error) {
manifestMap, err := mapping.NewFromYamlString(wt.Manifest)
if err != nil {
log.WithFields(log.Fields{
"Method": "FormatManifest",
"Step": "NewFromYamlString",
"Error": err.Error(),
}).Error("FormatManifest Workflow Template failed.")
return "", nil
}
manifestMap, err = manifestMap.GetChildMap("spec")
if err != nil {
log.WithFields(log.Fields{
"Method": "FormatManifest",
"Step": "GetChildMap",
"Error": err.Error(),
}).Error("GetChildMap Workflow Template failed.")
return "", nil
}
manifestMap.PruneEmpty()
wt.AddWorkflowTemplateParametersFromAnnotations(manifestMap)
manifestBytes, err := manifestMap.ToYamlBytes()
if err != nil {
log.WithFields(log.Fields{
"Method": "FormatManifest",
"Step": "ToYamlBytes",
"Error": err.Error(),
}).Error("ToYamlBytes Workflow Template failed.")
}
return string(manifestBytes), nil
}
// Take the manifest from the workflow template, which is just the "spec" contents
// and wrap it so we have
// {
// metadata: {},
// spec: spec_data
// }
// the above wrapping is what is returned.
func (wt *WorkflowTemplate) WrapSpec() ([]byte, error) {
data := wt.GetManifestBytes()
mapping := make(map[interface{}]interface{})
if err := yaml.Unmarshal(data, mapping); err != nil {
return nil, err
}
contentMap := map[interface{}]interface{}{
"metadata": make(map[interface{}]interface{}),
"spec": mapping,
}
finalBytes, err := yaml.Marshal(contentMap)
if err != nil {
return nil, nil
}
return finalBytes, nil
}
func (wt *WorkflowTemplate) AddWorkflowTemplateParametersFromAnnotations(spec mapping.Mapping) {
if wt.ArgoWorkflowTemplate == nil {
return
}
annotations := wt.ArgoWorkflowTemplate.Annotations
if spec == nil || len(annotations) == 0 {
return
}
arguments, err := spec.GetChildMap("arguments")
if err != nil {
return
}
arguments["parameters"] = make([]interface{}, 0)
parameters := make([]interface{}, len(annotations))
for _, value := range annotations {
data, err := mapping.NewFromYamlString(value)
if err != nil {
log.WithFields(log.Fields{
"Method": "AddWorkflowTemplateParametersFromAnnotations",
"Step": "NewFromYamlString",
"Error": err.Error(),
}).Error("Error with AddWorkflowTemplateParametersFromAnnotations")
continue
}
order := 0
orderValue, ok := data["order"]
if ok {
order = orderValue.(int)
delete(data, "order")
if order >= 0 && order < len(parameters) {
parameters[order] = data
}
}
}
arguments["parameters"] = parameters
}
type WorkflowExecution struct {
ID uint64
CreatedAt time.Time `db:"created_at"`
UID string
Name string
GenerateName string
Parameters []Parameter
ParametersBytes []byte `db:"parameters"` // to load from database
Manifest string
Phase wfv1.NodePhase
StartedAt *time.Time `db:"started_at"`
FinishedAt *time.Time `db:"finished_at"`
WorkflowTemplate *WorkflowTemplate `db:"workflow_template"`
Labels map[string]string
}
// TODO: reference this in WorkflowExecution
type WorkflowExecutionStatus struct {
Phase wfv1.NodePhase `json:"phase"`
StartedAt *time.Time `db:"started_at" json:"startedAt"`
FinishedAt *time.Time `db:"finished_at" json:"finishedAt"`
}
func (we *WorkflowExecution) LoadParametersFromBytes() ([]Parameter, error) {
loadedParameters := make([]Parameter, 0)
err := json.Unmarshal(we.ParametersBytes, &loadedParameters)
if err != nil {
return we.Parameters, err
}
// It might be nil because the value "null" is stored in db if there are no parameters.
// for consistency, we return an empty array.
if loadedParameters == nil {
loadedParameters = make([]Parameter, 0)
}
we.Parameters = loadedParameters
return we.Parameters, err
}
type ListOptions = metav1.ListOptions
type PodGCStrategy = wfv1.PodGCStrategy
type WorkflowExecutionOptions struct {
Name string
GenerateName string
Entrypoint string
Parameters []Parameter
ServiceAccount string
Labels *map[string]string
ListOptions *ListOptions
PodGCStrategy *PodGCStrategy
}
type File struct {
Path string
Name string
Size int64
Extension string
ContentType string
LastModified time.Time
Directory bool
}
// Given a path, returns the parent path, asssuming a '/' delimitor
// Result does not have a trailing slash.
// -> a/b/c/d would return a/b/c
// -> a/b/c/d/ would return a/b/c
// If path is empty string, it is returned.
// If path is '/' (root) it is returned as is.
// If there is no '/', '/' is returned.
func FilePathToParentPath(path string) string {
separator := "/"
if path == "" || path == separator {
return path
}
if strings.HasSuffix(path, "/") {
path = path[0 : len(path)-1]
}
lastIndexOfForwardSlash := strings.LastIndex(path, separator)
if lastIndexOfForwardSlash <= 0 {
return separator
}
return path[0:lastIndexOfForwardSlash]
}
func FilePathToExtension(path string) string {
dotIndex := strings.LastIndex(path, ".")
if dotIndex == -1 {
return ""
}
if dotIndex == (len(path) - 1) {
return ""
}
return path[dotIndex+1:]
}
func FilePathToName(path string) string {
if strings.HasSuffix(path, "/") {
path = path[:len(path)-1]
}
lastSlashIndex := strings.LastIndex(path, "/")
if lastSlashIndex < 0 {
return path
}
return path[lastSlashIndex+1:]
}
func WorkflowTemplatesToIds(workflowTemplates []*WorkflowTemplate) (ids []uint64) {
mappedIds := make(map[uint64]bool)
@@ -574,12 +98,14 @@ func WorkflowTemplatesToIds(workflowTemplates []*WorkflowTemplate) (ids []uint64
return
}
func WorkflowTemplatesToVersionIds(workflowTemplates []*WorkflowTemplate) (ids []uint64) {
// WorkflowTemplatesToVersionIDs picks out the WorkflowTemplateVersionID from each template and returns
// it as an array. Duplicates are removed.
func WorkflowTemplatesToVersionIDs(workflowTemplates []*WorkflowTemplate) (ids []uint64) {
mappedIds := make(map[uint64]bool)
// This is to make sure we don't have duplicates
for _, workflowTemplate := range workflowTemplates {
mappedIds[workflowTemplate.WorkflowTemplateVersionId] = true
mappedIds[workflowTemplate.WorkflowTemplateVersionID] = true
}
for id := range mappedIds {
@@ -588,102 +114,3 @@ func WorkflowTemplatesToVersionIds(workflowTemplates []*WorkflowTemplate) (ids [
return
}
func WorkflowTemplateVersionsToIds(resources []*WorkflowTemplateVersion) (ids []uint64) {
mappedIds := make(map[uint64]bool)
// This is to make sure we don't have duplicates
for _, resource := range resources {
mappedIds[resource.ID] = true
}
for id := range mappedIds {
ids = append(ids, id)
}
return
}
func CronWorkflowsToIds(resources []*CronWorkflow) (ids []uint64) {
mappedIds := make(map[uint64]bool)
// This is to make sure we don't have duplicates
for _, resource := range resources {
mappedIds[resource.ID] = true
}
for id := range mappedIds {
ids = append(ids, id)
}
return
}
// Returns a list of column names prefixed with alias, and named to destination. Extra columns are added to the end of the list.
// Setting destination to empty string will not apply any destination.
// Example - with destination
//
// Input: ([id, name], "w", "workflow")
// Output: [w.id "workflow.id", w.name "workflow.name"]
//
// Example - no destination
// Input: ([id, name], "w", "")
// Output: [w.id, w.name]
func formatColumnSelect(columns []string, alias, destination string, extraColumns ...string) []string {
results := make([]string, 0)
for _, str := range columns {
result := alias + "." + str
if destination != "" {
result += fmt.Sprintf(` "%v.%v"`, destination, str)
}
results = append(results, result)
}
results = append(results, extraColumns...)
return results
}
// returns all of the columns for workflowTemplate modified by alias, destination.
// see formatColumnSelect
func getWorkflowTemplateColumns(alias string, destination string, extraColumns ...string) []string {
columns := []string{"id", "created_at", "uid", "name", "namespace", "modified_at", "is_archived"}
return formatColumnSelect(columns, alias, destination, extraColumns...)
}
// returns all of the columns for workflow template versions modified by alias, destination.
// see formatColumnSelect
func getWorkflowTemplateVersionColumns(alias string, destination string, extraColumns ...string) []string {
columns := []string{"id", "uid", "created_at", "version", "is_latest", "manifest"}
return formatColumnSelect(columns, alias, destination, extraColumns...)
}
// returns all of the columns for workflowExecution modified by alias, destination.
// see formatColumnSelect
func getWorkflowExecutionColumns(alias string, destination string, extraColumns ...string) []string {
columns := []string{"id", "created_at", "uid", "name", "parameters", "phase", "started_at", "finished_at"}
return formatColumnSelect(columns, alias, destination, extraColumns...)
}
// returns all of the columns for cronWorkflow modified by alias, destination.
// see formatColumnSelect
func getCronWorkflowColumns(extraColumns ...string) []string {
results := []string{"cw.id", "cw.created_at", "cw.uid", "cw.name", "cw.workflow_template_version_id", "cw.manifest", "cw.namespace"}
for _, str := range extraColumns {
results = append(results, str)
}
return results
}
func LabelsToMapping(labels ...*Label) map[string]string {
result := make(map[string]string)
for _, label := range labels {
result[label.Key] = label.Value
}
return result
}

View File

@@ -3,14 +3,31 @@ package util
import (
"errors"
"fmt"
"google.golang.org/grpc/status"
"github.com/lib/pq"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// UserError implements a new error type for user facing errors
type UserError struct {
Code codes.Code
Message string
}
// Error returns error messages
func (e *UserError) Error() string {
return e.Message
}
// GRPCStatus is used by gRPC to return the correct gRPC status codes
func (e *UserError) GRPCStatus() *status.Status {
return status.New(e.Code, e.Message)
}
// NewUserError returns an instance of UserError with the appropriate code and message
func NewUserError(code codes.Code, message string) error {
return status.Errorf(code, message)
return &UserError{Code: code, Message: message}
}
func pqError(err *pq.Error) (code codes.Code) {
@@ -23,15 +40,19 @@ func pqError(err *pq.Error) (code codes.Code) {
return
}
// NewUserErrorWrap wraps pq errors and returns an instance of UserError
func NewUserErrorWrap(err error, entity string) error {
var (
code codes.Code
message string
pqErr *pq.Error
userErr *UserError
)
if errors.As(err, &pqErr) {
code = pqError(pqErr)
message = fmt.Sprintf("%v already exists.", entity)
} else if errors.As(err, &userErr) {
return err
} else {
code = codes.Unknown
message = "Unknown error."

57
pkg/util/gcs/gcs.go Normal file
View File

@@ -0,0 +1,57 @@
package gcs
import (
"cloud.google.com/go/storage"
log "github.com/sirupsen/logrus"
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
"google.golang.org/api/option"
"io"
)
// Client is a struct used for accessing Google Cloud Storage.
type Client struct {
*storage.Client
}
// NewClient handles the details of initializing the connection to Google Cloud Storage.
// - Note that the permissions are set to ReadWrite.
func NewClient(namespace string, serviceAccountJSON string) (gcsClient *Client, err error) {
ctx := context.Background()
creds, err := google.CredentialsFromJSON(ctx, []byte(serviceAccountJSON), storage.ScopeReadWrite)
if err != nil {
log.WithFields(log.Fields{
"Namespace": namespace,
"JSON": serviceAccountJSON,
"Error": err.Error(),
}).Error("GetGCSClient failed when initializing a new GCS client.")
return
}
client, err := storage.NewClient(ctx, option.WithCredentials(creds))
if err != nil {
log.WithFields(log.Fields{
"Namespace": namespace,
"JSON": serviceAccountJSON,
"Error": err.Error(),
}).Error("GetGCSClient failed when initializing a new GCS client.")
return
}
return &Client{Client: client}, nil
}
/* GetObject retrieves a specific object from Google Cloud Storage.
- Function Name is meant to be consistent with S3's.
*/
func (c *Client) GetObject(bucket, key string) (stream io.ReadCloser, err error) {
ctx := context.Background()
stream, err = c.Client.Bucket(bucket).Object(key).NewReader(ctx)
if err != nil {
return
}
if stream == nil {
defer stream.Close()
}
return
}

View File

@@ -17,6 +17,12 @@ const (
VersionLatest = OnepanelPrefix + "version-latest"
)
// Label represents a Key/Value pair label
type Label struct {
Key string
Value string
}
// Function that modifies an input string
type StringModifier func(string) string

View File

@@ -25,6 +25,20 @@ func NewRequest(page, pageSize int32) PaginationRequest {
}
}
// Start creates a new PaginationRequest that starts at the first page.
// You can provide an optional pageSize argument. If none is provided, 15 is used.
// All arguments apart from the first one are ignored.
func Start(pageSize ...int32) *PaginationRequest {
if len(pageSize) > 0 {
pr := NewRequest(1, pageSize[0])
return &pr
}
pr := NewRequest(1, 15)
return &pr
}
func (pr *PaginationRequest) Offset() uint64 {
// start at page 1.
return (pr.Page - 1) * pr.PageSize
@@ -44,3 +58,11 @@ func (pr *PaginationRequest) ApplyToSelect(sb *squirrel.SelectBuilder) *squirrel
return &result
}
// Advance returns a new pagination request with the page incremented by 1
func (pr *PaginationRequest) Advance() *PaginationRequest {
return &PaginationRequest{
Page: pr.Page + 1,
PageSize: pr.PageSize,
}
}

31
pkg/util/router/router.go Normal file
View File

@@ -0,0 +1,31 @@
package router
import (
"fmt"
)
// Web provides methods to generate urls for the web client
// this can be used to generate urls for workspaces or workflows when they are ready.
type Web interface {
WorkflowExecution(namespace, uid string) string
}
// web is a basic implementation of WebRouter
type web struct {
protocol string
fqdn string
}
// WorkflowExecution generates a url to view a specific workflow
func (w *web) WorkflowExecution(namespace, uid string) string {
// <protocol>:<fqdn>/<namespace>/workflows/<uid>
return fmt.Sprintf("%v%v/%v/workflows/%v", w.protocol, w.fqdn, namespace, uid)
}
// NewWebRouter creates a new web router used to generate urls for the web client
func NewWebRouter(protocol, fqdn string) (Web, error) {
return &web{
protocol: protocol,
fqdn: fqdn,
}, nil
}

Some files were not shown because too many files have changed in this diff Show More