Commit 565053f9 authored by Gregory Harris's avatar Gregory Harris
Browse files

Improving the README.md

parent 93a06e03
Pipeline #77307 passed with stages
in 56 seconds
......@@ -34,9 +34,48 @@ There are several groups:
* `search`: Search for a wellbore given a well name.
* `update`: Update the existing bulk data for a given welllog
The `lascli` reads configuration information from a [configuration file](#config-file).
The path to this file must either be provided in the environment variable `CONFIGPATH` or as a command line option.
All the commands that connect to an OSDU instance require a bearer token.
This must be provided either in the environment variable `OSDUTOKEN` or as a command line option.
### Environment variables
| Varaible name | overriding command option | Comment |
| ------------- | --------------------------| ------- |
| OSDUTOKEN | `--token` `-t` | The JWT required to authenticate against an OSDU instance. |
| CONFIGPATH | `--config_path` `-c` | The path to the configuration file |
### Config file
The LASCLI requires a configuration file that has the following JSON structure:
```
{
"base_url": "https://osdu-ship.msft-osdu-test.org",
"data_partition_id": "opendes",
"acl_domain": "contoso.com",
"legal":
{
"legaltags": ["opendes-public-usa-dataset-7643990"],
"otherRelevantDataCountries": ["US"],
"status": "compliant"
},
"data": {
"default": {
"viewers": [ "data.default.viewers@opendes.contoso.com" ],
"owners": [ "data.default.owners@opendes.contoso.com" ]
}
}
}
```
The `base_url`, `data_partition_id` and `acl_domain` must be correct for the OSDU instance you want to connect to. An example configuration file that is setup for the preship OSDU instance is given in `src/example_opendes_configuration.json`.
## Development
The application uses a virtual environment managed by pipenv. To execute the application and run the tests you will need to install Python 3.9 and pipenv.
The following instructions are provided as guidance for setting up a development environment for lasloader. For development work we use a virtual environment managed by pipenv. To execute the application and run the tests you will need to install Python 3.8+ and pipenv.
The source code and unit test are stored in the `src` folder.
To download the package dependencies for the virtual environment change to the src folder and run:
......@@ -71,36 +110,6 @@ Production packages should be installed using:
```
pipenv install package_name
```
### Usage via the command line interface
To invoke the CLI using the virtual environment and from within the `src` folder:
```
pipenv run python -m lasloader.lascli <group> <command> <options>
```
Available groups are `fileload`, `ingest`, `list`, `update` and `download`. Help can be obtained with the `-h` option.
```
pipenv run python -m lasloader.lascli -h
pipenv run python -m lasloader.lascli fileload -h
pipenv run python -m lasloader.lascli fileload convert -h
```
A token is required to access an OSDU instance. The `-t/--token` option is used to specify the token, this is a string. As tokens are long strings we recommend that the token is stored in an environment variable.
For example, on a Windows PowerShell prompt:
```
set OSDUTOKEN <token>
pipenv run python -m lasloader.lascli ingest wellbore -t $OSDUTOKEN
```
Or Windows command prompt:
```
set OSDUTOKEN=<token>
pipenv run python -m lasloader.lascli ingest wellbore -t %OSDUTOKEN%
```
Many commands require a bearer token and filepath to a configuration file. If these are set as environment variables (named
'OSDUTOKEN' and 'CONFIGPATH' respectively), it is not necessary to provide them as arguments for commands (the CLI defaults to
use the environment variable).
## Deploy
### Install from repository source
......@@ -132,28 +141,5 @@ Packages are published to the community package registry via the CI pipeline. Pa
Run the publish job for the build you want to publish. It will build and upload `lasloader` with a specific package version number. The package version number is the `__VERSION__` found in the `__init__.py` file for the module followed by a build tag. The build tag is based upon the CI build_id:
1. The default build tag is an alpha release of the form 1.2.3a456
1. If the repo branch has been tagged with a string starting wih `BETA` then the beta release form is used 1.2.3b456.
1. If the repo branch has been tagged with a string starting wih `RELEASE` then the primary release form is used 1.2.3.456.
## Config file
The LASCLI requires a configuration file that has the following JSON structure:
```
{
"base_url": "https://osdu-ship.msft-osdu-test.org",
"data_partition_id": "opendes",
"acl_domain": "contoso.com",
"legal":
{
"legaltags": ["opendes-public-usa-dataset-7643990"],
"otherRelevantDataCountries": ["US"],
"status": "compliant"
},
"data": {
"default": {
"viewers": [ "data.default.viewers@opendes.contoso.com" ],
"owners": [ "data.default.owners@opendes.contoso.com" ]
}
}
}
```
1. If the repo branch has been tagged with a string starting with `BETA` then the beta release form is used 1.2.3b456.
1. If the repo branch has been tagged with a string starting with `RELEASE` then the primary release form is used 1.2.3.456.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment