Skip to content

Commit

Permalink
DOC: Add usage instructions to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Feb 24, 2025
1 parent 96a56fa commit 5584590
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,47 @@
# example-service-kueue
An example Octue Twined data service using Kueue as the service backend.

An example Octue Twined data service using Kubernetes/Kueue as the service backend.

The terraform modules this service depends on are:

- [Octue Twined core](https://github.com/octue/terraform-octue-twined-core)
- [Octue Twined cluster](https://github.com/octue/terraform-octue-twined-cluster)

## Usage

### Install the client

```shell
pip install octue
```

## Usage

### Authenticate with GCP

Download a key for a developer service account and set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable:

```shell
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/gcp-credentials.json
```

### Interact with the service

Run the following python code:

```python
from octue.resources import Child


# Point to the data service
child = Child(
id="octue/example-service:0.1.0",
backend={"name": "GCPPubSubBackend", "project_name": "octue-sdk-python"},
)

# Ask a question
answer, _ = child.ask(input_values={"n_iterations": 5}, timeout=3600)

# Access the output data
answer
```

0 comments on commit 5584590

Please sign in to comment.