From 09cdcb02c93113a0578d34443a0e89c6eb165372 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 13 Aug 2019 15:18:31 -0700 Subject: [PATCH 1/4] Updated readme --- README.md | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 27bf588..68e3519 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,106 @@ pip install wcm ``` +## Example usage + +First we want to install wcm + +```bash +C:\Users\Admin>pip install wcm +``` + +Now that ive installed wcm I need to configure my credentials to use a wings server + +```bash +C:\Users\Admin>wcm configure +WINGS Server URL: +WINGS Export URL: http://localhost:8080 +WINGS User: myUsername +WINGS Password: +WINGS Domain: wings-domain +Success + +``` + +Once ive established my credentials I can begin using wcm. First I want to see the components on my current wings instance + +```bash +C:\Users\Admin>wcm list +[Economic] + └─┐ + ├─ economic-v6 + ├─ economictest-v5 + ├─ economicnodata-v6 + ├─ economic-different-data-v6 + └─ economicwcmtest + +[Hydrological] + └─┐ + ├─ HAND-1 + ├─ hand_final-v1 + ├─ hand-v1 + └─ handnodata-v1.0.1 + +Done +``` + +Next I want to download one of these components. Lets choose economic-v6. First I need to navigate into the directory I want to download the component to. Alternatively I could also use the -f argument to specify a filepath for the component to be downloaded to + +```bash +C:\Users\Admin\Desktop\down>ls + +C:\Users\Admin\Desktop\down>wcm download economic-v6 +2019-08-13 14:52:02,082 root INFO Downloading component +2019-08-13 14:52:02,226 root INFO Generated YAML +2019-08-13 14:52:02,256 root INFO Download complete +Download complete + +C:\Users\Admin\Desktop\down>ls +economic-v6 +``` + +When you download a component it comes in three parts. The wings-component.yaml file which stores the components data. The src folder which stores the sorce code. And the data folder, which at the moment is just a placeholder + +After I downloaded the economic-v6 component I edited some of the source code and changed the version to v6.1. Now I want to upload it, this is done with the publish command + +```bash +C:\Users\Admin\Desktop\down>ls +economic-v6.1 + +C:\Users\Admin\Desktop\down>wcm publish economic-v6.1 +2019-08-13 15:04:08,540 root INFO Publishing component +Success + +``` + +Now lets check the list command to make sure it was published + +```bash +C:\Users\Admin\Desktop\down>wcm list +[Economic] + └─┐ + ├─ economic-v6 + ├─ economictest-v5 + ├─ economicnodata-v6 + ├─ economic-different-data-v6 + ├─ economicwcmtest + └─ economic-v6.1 + +[Hydrological] + └─┐ + ├─ HAND-1 + ├─ hand_final-v1 + ├─ hand-v1 + └─ handnodata-v1.0.1 + +Done +``` + +And now my economic-v6.1 component has been uploaded to my wings instance ## CLI -`wcm` WINGS Component Manager is a cli utility to `publish` WINGS component to a WINGS instance. +`wcm` WINGS Component Manager is a cli utility to `publish` and `download` WINGS component to a WINGS instance. ```bash $ wcm --help @@ -28,7 +124,9 @@ Options: Commands: configure Configure credentials + download Download a component from the wings server. init Initialize a directory for a new component. + list Lists all the components in the current wings instance publish Deploy the pacakge to the wcm. version Show wcm version. ``` @@ -72,3 +170,28 @@ Options: -n, --dry-run --help Show this message and exit. ``` + +The `download` sub command will download a component from the current wings server. + +```bash +$ wcm download --help +Usage: wcm download [OPTIONS] COMPONENT_ID +Download a component from wings server. Data stored in .yaml file and source code downloaded to folder within same directory. file-path can be specified to download into a specific directory + +Options: + -p, --profile + -f, --file-path TEXT + --help Show this message and exit. +``` + +The `list` sub command lists all the component's names from the current wings server + +```bash +$ wcm list --help +Usage: wcm list [OPTIONS] +Lists all the components in the current wings instance + +Options: +-p, --profile +--help Show this message and exit. +``` From 41c8e35be1072db12d00f7f3f8b4a4e655b5ca1b Mon Sep 17 00:00:00 2001 From: Cmheidelberg Date: Tue, 13 Aug 2019 18:22:32 -0700 Subject: [PATCH 2/4] Added wings properties to schema Added wings properties to schema: - inputs - outputs - rules - inheritedRules - documentation - requirements - componentType - files --- src/wcm/__main__.py | 2 +- src/wcm/_schema.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/wcm/__main__.py b/src/wcm/__main__.py index ce62c30..e6760b4 100644 --- a/src/wcm/__main__.py +++ b/src/wcm/__main__.py @@ -73,7 +73,7 @@ def init(component, yes=False): with Path("wings-component.yml").open("w") as fh: fh.write(spec) click.secho(f"Success", fg="green") - except: + except FileNotFoundError: with Path("wings-component.yaml").open("w") as fh: fh.write(spec) click.secho(f"Success", fg="green") diff --git a/src/wcm/_schema.py b/src/wcm/_schema.py index efcb185..c450bae 100644 --- a/src/wcm/_schema.py +++ b/src/wcm/_schema.py @@ -60,7 +60,21 @@ }, "source": {"type": "string"}, "schemaVersion": {"type": "string"}, + "wings": { + "type": ["object"], + "properties": { + "inputs": {"type": "array", "items": {"$ref": "#/definitions/ioData"}}, + "outputs": {"type": "array", "items": {"$ref": "#/definitions/ioData"}}, + "rules": {"type": ["string","array"]}, + "inheritedRules": {"type": ["string", "array"]}, + "documentation": {"type": "string"}, + "requirement": {"type": "object", "items": {"$ref": "/definitions/requirements"}}, + "componentType": {"type": "string"}, + "files": {"type": "array", "items": {"type": "string"}}, + }, + }, }, + "definitions": { "person": { "type": ["object", "string"], @@ -71,6 +85,27 @@ "email": {"type": "string", "format": "email"}, }, }, + "ioData": { + "type": ["object"], + "required": ["role", "prefix", "isParam", "type", "dimensionality"], + "properties": { + "role": {"type": "string"}, + "prefix": {"type": "string"}, + "isParam": {"type": "boolean"}, + "type": {"type": "string"}, + "dimensionality": {"type": "integer"} + }, + }, + "requirement": { + "type": ["object"], + "properties": { + "storageGB": {"type": "double"}, + "memoryGB": {"type": "double"}, + "need64bit": {"type": "boolean"}, + "softwareIds": {"type": "array", "items": {"type": "string"}}, + + }, + }, "organization": { "type": ["object", "string"], "required": ["name"], @@ -80,6 +115,7 @@ }, }, }, + } #Missing extension for variables of each input and variable of each output From 4aa8001ebd317f559dbad7355dbc93af430b8feb Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Tue, 13 Aug 2019 22:55:51 -0400 Subject: [PATCH 3/4] Release v0.0.7 --- src/wcm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wcm/__init__.py b/src/wcm/__init__.py index e16123b..178279a 100644 --- a/src/wcm/__init__.py +++ b/src/wcm/__init__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = "0.0.6" +__version__ = "0.0.7" From e65dad4d4415c851ddcec95108f653d3ad23d808 Mon Sep 17 00:00:00 2001 From: Daniel Garijo Date: Tue, 13 Aug 2019 20:05:36 -0700 Subject: [PATCH 4/4] Update README.md --- README.md | 181 ++++++++++++++++++++++++++---------------------------- 1 file changed, 88 insertions(+), 93 deletions(-) diff --git a/README.md b/README.md index 68e3519..3ba010f 100644 --- a/README.md +++ b/README.md @@ -12,16 +12,95 @@ ```bash pip install wcm ``` +## CLI -## Example usage +`wcm` WINGS Component Manager is a cli utility to `publish` and `download` WINGS component to a WINGS instance. + +```bash +$ wcm --help +Usage: wcm [OPTIONS] COMMAND [ARGS]... + +Options: + -v, --verbose + --help Show this message and exit. + +Commands: + configure Configure credentials + download Download a component from the wings server. + init Initialize a directory for a new component. + list Lists all the components in the current wings instance + publish Deploy the pacakge to the wcm. + version Show wcm version. +``` + +The `configure` sub command is used to setup credentials used by `wcm` to interact with WINGS server(s). + +```bash +$ wcm configure --help +Usage: wcm configure [OPTIONS] + + Configure credentials + +Options: + -p, --profile + --help Show this message and exit. +``` + +The `init` sub command is used to initialze a new WINGS component on the file-system. + +```bash +$ wcm init --help +Usage: wcm init [OPTIONS] [COMPONENT] + + Initialize a directory for a new component. + +Options: + -y, --yes + --help Show this message and exit. +``` + +The `publish` sub command publishes a component to a WINGS server. + +```bash +$ wcm publish --help +Usage: wcm publish [OPTIONS] [COMPONENT] + + Deploy the pacakge to the wcm. + +Options: + -d, --debug / -nd, --no-debug + -n, --dry-run + --help Show this message and exit. +``` + +The `download` sub command will download a component from the current wings server. + +```bash +$ wcm download --help +Usage: wcm download [OPTIONS] COMPONENT_ID +Download a component from wings server. Data stored in .yaml file and source code downloaded to folder within same directory. file-path can be specified to download into a specific directory -First we want to install wcm +Options: + -p, --profile + -f, --file-path TEXT + --help Show this message and exit. +``` + +The `list` sub command lists all the component's names from the current wings server ```bash -C:\Users\Admin>pip install wcm +$ wcm list --help +Usage: wcm list [OPTIONS] +Lists all the components in the current wings instance + +Options: +-p, --profile +--help Show this message and exit. ``` -Now that ive installed wcm I need to configure my credentials to use a wings server +## Example usage + +Once wcm is installed, configure your credentials to use a wings server ```bash C:\Users\Admin>wcm configure @@ -34,7 +113,7 @@ Success ``` -Once ive established my credentials I can begin using wcm. First I want to see the components on my current wings instance +Now you can begin using wcm. First list the components on the wings instance you specified on the credentials ```bash C:\Users\Admin>wcm list @@ -56,12 +135,12 @@ C:\Users\Admin>wcm list Done ``` -Next I want to download one of these components. Lets choose economic-v6. First I need to navigate into the directory I want to download the component to. Alternatively I could also use the -f argument to specify a filepath for the component to be downloaded to +Next, you can download one of these components. Let's choose economic-v6. First you need to navigate into the directory you want to download the component to. Alternatively you could also use the -f argument to specify a filepath for the component to be downloaded to ```bash C:\Users\Admin\Desktop\down>ls -C:\Users\Admin\Desktop\down>wcm download economic-v6 +C:\Users\Admin\Desktop\down>wcm download economic-v5 2019-08-13 14:52:02,082 root INFO Downloading component 2019-08-13 14:52:02,226 root INFO Generated YAML 2019-08-13 14:52:02,256 root INFO Download complete @@ -73,7 +152,7 @@ economic-v6 When you download a component it comes in three parts. The wings-component.yaml file which stores the components data. The src folder which stores the sorce code. And the data folder, which at the moment is just a placeholder -After I downloaded the economic-v6 component I edited some of the source code and changed the version to v6.1. Now I want to upload it, this is done with the publish command +After downloading the economic-v5 component, you may edit some of the source code. To upload a new version (6.1 in the example), use the publish command ```bash C:\Users\Admin\Desktop\down>ls @@ -108,90 +187,6 @@ C:\Users\Admin\Desktop\down>wcm list Done ``` -And now my economic-v6.1 component has been uploaded to my wings instance +And now the economic-v6.1 component has been uploaded to WINGS -## CLI -`wcm` WINGS Component Manager is a cli utility to `publish` and `download` WINGS component to a WINGS instance. - -```bash -$ wcm --help -Usage: wcm [OPTIONS] COMMAND [ARGS]... - -Options: - -v, --verbose - --help Show this message and exit. - -Commands: - configure Configure credentials - download Download a component from the wings server. - init Initialize a directory for a new component. - list Lists all the components in the current wings instance - publish Deploy the pacakge to the wcm. - version Show wcm version. -``` - -The `configure` sub command is used to setup credentials used by `wcm` to interact with WINGS server(s). - -```bash -$ wcm configure --help -Usage: wcm configure [OPTIONS] - - Configure credentials - -Options: - -p, --profile - --help Show this message and exit. -``` - -The `init` sub command is used to initialze a new WINGS component on the file-system. - -```bash -$ wcm init --help -Usage: wcm init [OPTIONS] [COMPONENT] - - Initialize a directory for a new component. - -Options: - -y, --yes - --help Show this message and exit. -``` - -The `publish` sub command publishes a component to a WINGS server. - -```bash -$ wcm publish --help -Usage: wcm publish [OPTIONS] [COMPONENT] - - Deploy the pacakge to the wcm. - -Options: - -d, --debug / -nd, --no-debug - -n, --dry-run - --help Show this message and exit. -``` - -The `download` sub command will download a component from the current wings server. - -```bash -$ wcm download --help -Usage: wcm download [OPTIONS] COMPONENT_ID -Download a component from wings server. Data stored in .yaml file and source code downloaded to folder within same directory. file-path can be specified to download into a specific directory - -Options: - -p, --profile - -f, --file-path TEXT - --help Show this message and exit. -``` - -The `list` sub command lists all the component's names from the current wings server - -```bash -$ wcm list --help -Usage: wcm list [OPTIONS] -Lists all the components in the current wings instance - -Options: --p, --profile ---help Show this message and exit. -```