Skip to content

Commit 0e40550

Browse files
authored
MRG: Merge pull request #723 from octue/rc-kueue
Switch to Kueue service backend
2 parents 12c120a + 4f8b1f0 commit 0e40550

File tree

92 files changed

+3730
-3696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3730
-3696
lines changed

.github/workflows/build-docker-image.yml

-35
This file was deleted.

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ENV/
9898
# See: https://github.com/google-github-actions/auth/issues/123
9999
google_credentials.json
100100
gha-creds-*.json
101-
gcp-creds-*.json
101+
gcp-cred*
102102
terraform/gcp-credentials.json
103103
.terraform
104104

.pre-commit-config.yaml

+8-6
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,24 @@ repos:
1313
- id: check-added-large-files
1414

1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.6.9
16+
rev: v0.9.2
1717
hooks:
1818
- id: ruff
19+
name: Ruff lint
1920
args: [--fix, --exit-non-zero-on-fix]
21+
22+
- id: ruff
23+
name: Ruff isort
24+
args: [check, --select, I, --fix]
25+
2026
- id: ruff-format
27+
name: Ruff format
2128

2229
- repo: https://github.com/pre-commit/mirrors-prettier
2330
rev: v2.7.1
2431
hooks:
2532
- id: prettier
2633

27-
- repo: https://github.com/pycqa/pydocstyle
28-
rev: 6.1.1
29-
hooks:
30-
- id: pydocstyle
31-
3234
- repo: https://github.com/thclark/pre-commit-sphinx
3335
rev: 0.0.3
3436
hooks:

Dockerfile

-17
This file was deleted.

docs/source/asking_questions.rst

+14-15
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,18 @@ You can also set the following options when you call :mod:`Child.ask <octue.reso
6363
- ``subscribe_to_logs`` - if true, the child will forward its logs to you
6464
- ``allow_local_files`` - if true, local files/datasets are allowed in any input manifest you supply
6565
- ``handle_monitor_message`` - if provided a function, it will be called on any monitor messages from the child
66-
- ``record_events`` – if ``True``, events received from the parent while it processes the question are saved to the ``Child.received_events`` property
66+
- ``record_events`` – if true, events received from the parent while it processes the question are saved to the ``Child.received_events`` property
6767
- ``save_diagnostics`` – must be one of {"SAVE_DIAGNOSTICS_OFF", "SAVE_DIAGNOSTICS_ON_CRASH", "SAVE_DIAGNOSTICS_ON"}; if turned on, allow the input values and manifest (and its datasets) to be saved by the child either all the time or just if the analysis fails
6868
- ``question_uuid`` - if provided, the question will use this UUID instead of a generated one
6969
- ``push_endpoint`` - if provided, the result and other events produced during the processing of the question will be pushed to this HTTP endpoint (a URL)
70-
- ``asynchronous`` - if ``True``, don't wait for an answer to the question (the result and other events can be :ref:`retrieved from the event store later <retrieving_asynchronous_answers>`)
70+
- ``asynchronous`` - if true, don't wait for an answer to the question (the result and other events can be :ref:`retrieved from the event store later <retrieving_asynchronous_answers>`)
71+
- ``cpus`` - the number of CPUs to request for the question; defaults to the number set by the child service
72+
- ``memory`` - the amount of memory to request for the question e.g. "256Mi" or "1Gi"; defaults to the amount set by the child service
73+
- ``ephemeral_storage`` - the amount of ephemeral storage to request for the question e.g. "256Mi" or "1Gi"; defaults to the amount set by the child service
7174
- ``timeout`` - how long in seconds to wait for an answer (``None`` by default - i.e. don't time out)
7275

7376
If the question fails:
77+
7478
- If ``raise_errors=False``, the unraised error is returned
7579
- If ``raise_errors=False`` and ``max_retries > 0``, the question is retried up to this number of times
7680
- If ``raise_errors=False``, ``max_retries > 0``, and ``prevent_retries_when`` is a list of exception types, the question is retried unless the error type is in the list
@@ -101,14 +105,12 @@ access the event store and run:
101105
102106
from octue.cloud.pub_sub.bigquery import get_events
103107
104-
events = get_events(
105-
table_id="your-project.your-dataset.your-table",
106-
question_uuid="53353901-0b47-44e7-9da3-a3ed59990a71",
107-
)
108+
events = get_events(question_uuid="53353901-0b47-44e7-9da3-a3ed59990a71")
108109
109110
110111
**Options**
111112

113+
- ``table_id`` - If you're not using the standard deployment, you can specify a different table here
112114
- ``question_uuid`` - Retrieve events from this specific question
113115
- ``parent_question_uuid`` - Retrieve events from questions triggered by the same parent question (this doesn't include the parent question's events)
114116
- ``originator_question_uuid`` - Retrieve events for the entire tree of questions triggered by an originator question (a question asked manually through ``Child.ask``; this does include the originator question's events)
@@ -219,7 +221,7 @@ This method uses multithreading, allowing all the questions to be asked at once
219221

220222
Asking a question within a service
221223
==================================
222-
If you have :doc:`created your own Octue service <creating_services>` and want to ask children questions, you can do
224+
If you have :doc:`created your own Twined service <creating_services>` and want to ask children questions, you can do
223225
this more easily than above. Children are accessible from the ``analysis`` object by the keys you give them in the
224226
:ref:`app configuration <app_configuration>` file. For example, you can ask an ``elevation`` service a question like
225227
this:
@@ -351,20 +353,17 @@ whole tree of children, grandchildren, and so on, please `upvote this issue.
351353
Using a service registry
352354
========================
353355
When asking a question, you can optionally specify one or more `service registries
354-
<https://django-twined.readthedocs.io/en/latest/>`_ to resolve SRUIDs against. This is analogous to specifying a
355-
different ``pip`` index for resolving package names when using ``pip install``. If you don't specify any registries, the
356-
default Octue service registry is used.
357-
358-
Specifying service registries can be useful if:
356+
<https://django-twined.readthedocs.io/en/latest/>`_ to resolve SRUIDs against. This checks if the service revision
357+
exists (good for catching typos in SRUIDs) and raises an error if it doesn't. Service registries can also get the
358+
default revision of a service if you don't provide a revision tag. Asking a question if without specifying a registry
359+
will bypass these checks.
359360

360-
- You have your own private services that aren't on the default Octue service registry
361-
- You want services from one service registry with the same name as in another service registry to be prioritised
362361

363362
Specifying service registries
364363
-----------------------------
365364
You can specify service registries in two ways:
366365

367-
1. Globally for all questions asked inside a service. In the service configuration (``octue.yaml`` file):
366+
1. For all questions asked inside a service. In the service configuration (``octue.yaml`` file):
368367

369368
.. code-block:: yaml
370369

docs/source/authentication.rst

+22-19
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,45 @@ Authentication
44
You need authentication while using ``octue`` to:
55

66
- Access data from Google Cloud Storage
7-
- Use, run, or deploy Octue services
7+
- Use, run, or deploy Twined services
88

9-
Authentication can be provided by using one of:
10-
11-
- A service account
12-
- Application Default Credentials
9+
Authentication is provided by a GCP service account.
1310

1411
Creating a service account
1512
==========================
16-
1. Create a service account (see Google's `getting started guide <https://cloud.google.com/docs/authentication/getting-started>`__)
17-
2. Make sure your service account has access to any buckets you need, Google Pub/Sub, and Google Cloud Run if your
18-
service is deployed on it (`see here <https://cloud.google.com/storage/docs/access-control/using-iam-permissions>`_)
13+
By setting up your Twined service network with the :doc:`Twined Terraform modules <deploying_services>`, a set of
14+
maintainer service accounts have already been created with the required permissions.
1915

2016
Using a service account
2117
=======================
2218

2319
Locally
2420
-------
25-
1. Create and download a key for your service account - it will be called ``your-project-XXXXX.json``.
21+
1. Access your service accounts `here <https://console.cloud.google.com/iam-admin/serviceaccounts>`_, making sure the
22+
correct project is selected
23+
24+
2. Click on the relevant service account, go to the "Keys" tab, and create (download) a JSON key for it - it will be
25+
called ``<project-name>-XXXXX.json``.
2626

2727
.. DANGER::
2828

2929
It's best not to store this in your project to prevent accidentally committing it or building it into a docker
30-
image layer. Instead, bind mount it into your docker image from somewhere else on your local system.
30+
image layer. Instead, keep it somewhere else on your local system with any other service account keys you already
31+
have.
3132

32-
If you must keep within your project, it's good practice to name the file ``gha-greds-<whatever>.json`` and make
33-
sure that ``gha-creds-*`` is in your ``.gitignore`` and ``.dockerignore`` files.
33+
If you must keep within your project, it's good practice to name the file ``gcp-credentials.json`` and make
34+
sure that ``gcp-cred*`` is in your ``.gitignore`` and ``.dockerignore`` files.
3435

35-
2. If you're developing in a container (like a VSCode ``.devcontainer``), mount the file into the container. You can
36+
2. If you're developing in a container (like a VSCode ``devcontainer``), mount the file into the container. You can
3637
make gcloud available too - check out `this tutorial
3738
<https://medium.com/datamindedbe/application-default-credentials-477879e31cb5>`_.
3839

39-
3. Set the ``GOOGLE_APPLICATION_CREDENTIALS`` environment variable to the path of the key file.
40+
3. Set the ``GOOGLE_APPLICATION_CREDENTIALS`` environment variable to the absolute path of the key file. If using a
41+
``devcontainer``, make sure this is the path inside the container and not the path on your local machine.
4042

41-
On GCP infrastructure
42-
---------------------
43-
- Credentials are provided when running code on GCP infrastructure (e.g. Google Cloud Run)
44-
- ``octue`` uses these when when running on these platforms
45-
- You should ensure the correct service account is being used by the deployed instance
43+
On GCP infrastructure / deployed services
44+
-----------------------------------------
45+
- Credentials are automatically provided when running code or services on GCP infrastructure, including the Kubernetes
46+
cluster
47+
- ``octue`` uses these when when running on these platforms, so there's no need to upload a service account key or
48+
include one in service docker images

docs/source/bibliography.rst

-128
This file was deleted.

docs/source/creating_apps.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Accessing inputs and storing outputs
5858
------------------------------------
5959
Your app must access configuration and input data from and store output data on the :mod:`analysis <octue.resources.analysis.Analysis>`
6060
parameter (for function-based apps) or attribute (for class-based apps). This allows standardised
61-
configuration/input/output validation against the twine and interoperability of all Octue services while leaving you
61+
configuration/input/output validation against the twine and interoperability of all Twined services while leaving you
6262
freedom to do any kind of computation. To access the data, use the following attributes on the ``analysis``
6363
parameter/attribute:
6464

0 commit comments

Comments
 (0)