Skip to content

Commit 1b34ab9

Browse files
authored
MRG: Merge pull request #737 from octue/move-current-sdk-code-into-twined
Move current Octue SDK code into `twined` subpackage
2 parents 713bf72 + 4225424 commit 1b34ab9

File tree

193 files changed

+1460
-1464
lines changed

Some content is hidden

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

193 files changed

+1460
-1464
lines changed

.github/workflows/version-compatibility.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: version-compatibility
1+
name: twined-version-compatibility
22

33
on:
44
push:
@@ -15,4 +15,4 @@ jobs:
1515
- name: Install Poetry
1616
uses: snok/install-poetry@v1
1717
- name: Check version compatibility has been tested
18-
run: python scripts/check_version_compatibility_tested.py
18+
run: python scripts/check_twined_version_compatibility_tested.py

docs/source/api.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ Manifest
2323

2424
Analysis
2525
========
26-
.. autoclass:: octue.resources.analysis.Analysis
26+
.. autoclass:: octue.twined.resources.analysis.Analysis
2727
:inherited-members:
2828

2929

3030
Child
3131
=====
32-
.. autoclass:: octue.resources.child.Child
32+
.. autoclass:: octue.twined.resources.child.Child
3333

3434

3535
Child emulator
3636
==============
37-
.. autoclass:: octue.cloud.emulators.child.ChildEmulator
37+
.. autoclass:: octue.twined.cloud.emulators.child.ChildEmulator
3838

3939

4040
Filter containers
@@ -61,17 +61,17 @@ Configuration
6161

6262
Service configuration
6363
---------------------
64-
.. autoclass:: octue.configuration.ServiceConfiguration
64+
.. autoclass:: octue.twined.configuration.ServiceConfiguration
6565

6666

6767
Runner
6868
======
69-
.. autoclass:: octue.runner.Runner
69+
.. autoclass:: octue.twined.runner.Runner
7070

7171

7272
Octue essential monitor messages
7373
================================
74-
.. automodule:: octue.essentials.monitor_messages
74+
.. automodule:: octue.twined.essentials.monitor_messages
7575

7676

7777
Octue log handler

docs/source/asking_questions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Asking a question
2828

2929
.. code-block:: python
3030
31-
from octue.resources import Child
31+
from octue.twined.resources import Child
3232
3333
child = Child(
3434
id="my-organisation/my-service:2.1.7",
@@ -103,7 +103,7 @@ access the event store and run:
103103

104104
.. code-block:: python
105105
106-
from octue.cloud.pub_sub.bigquery import get_events
106+
from octue.twined.cloud.pub_sub.bigquery import get_events
107107
108108
events = get_events(question_uuid="53353901-0b47-44e7-9da3-a3ed59990a71")
109109

docs/source/inter_service_compatibility.rst

Lines changed: 119 additions & 117 deletions
Large diffs are not rendered by default.

docs/source/manifest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Get a Twined service to analyse data for you as part of a larger analysis.
4242

4343
.. code-block:: python
4444
45-
from octue.resources import Child
45+
from octue.twined.resources import Child
4646
4747
child = Child(
4848
id="octue/wind-speed:2.1.0",

docs/source/running_services_locally.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ like this:
3535

3636
.. code-block:: python
3737
38-
from octue import Runner
38+
from octue.twined.runner import Runner
3939
4040
runner = Runner(app_src="path/to/app.py", twine="path/to/twine.json")
4141
analysis = runner.run(input_values={"height": 5, "width": 10})

docs/source/testing_services.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ To emulate your children in tests, patch the :mod:`Child <octue.resources.child.
138138
139139
from unittest.mock import patch
140140
141-
from octue import Runner
142-
from octue.cloud.emulators import ChildEmulator
141+
from octue.twined.runner import Runner
142+
from octue.twined.cloud.emulators import ChildEmulator
143143
144144
145145
app_directory_path = "path/to/directory_containing_app"
@@ -227,7 +227,7 @@ child.
227227
.. code-block:: python
228228
229229
import json
230-
from octue.resources import Child
230+
from octue.twined.resources import Child
231231
232232
233233
child = Child(
@@ -276,7 +276,7 @@ You can then feed these into a child emulator to emulate one possible response o
276276

277277
.. code-block:: python
278278
279-
from octue.cloud.emulators import ChildEmulator
279+
from octue.twined.cloud.emulators import ChildEmulator
280280
281281
282282
child_emulator = ChildEmulator(events=child.received_events)

docs/source/troubleshooting_services.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ your service to fail.
6363
6464
from unittest.mock import patch
6565
66-
from octue import Runner
67-
from octue.utils.testing import load_test_fixture_from_diagnostics
66+
from octue.twined.runner import Runner
67+
from octue.twined.utils.testing import load_test_fixture_from_diagnostics
6868
6969
7070
(

octue/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
import os
33

44
from .log_handlers import apply_log_handler, should_use_octue_log_handler
5-
from .runner import Runner
65

76
logger = logging.getLogger(__name__)
87

9-
10-
__all__ = ("Runner",)
118
REPOSITORY_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
129

1310
if should_use_octue_log_handler():

octue/cli.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@
99
from google import auth
1010

1111
from octue.cloud import storage
12-
from octue.cloud.events.answer_question import answer_question
13-
from octue.cloud.events.question import make_question_event
14-
from octue.cloud.events.replayer import EventReplayer
15-
from octue.cloud.events.validation import VALID_EVENT_KINDS
16-
from octue.cloud.pub_sub.bigquery import DEFAULT_EVENT_STORE_TABLE_ID, get_events
17-
from octue.cloud.pub_sub.service import Service
18-
from octue.cloud.service_id import create_sruid, get_sruid_parts
1912
from octue.cloud.storage import GoogleCloudStorageClient
20-
from octue.configuration import ServiceConfiguration
21-
from octue.definitions import LOCAL_SDK_VERSION, MANIFEST_FILENAME, VALUES_FILENAME
22-
from octue.exceptions import ServiceAlreadyExists
13+
from octue.definitions import LOCAL_SDK_VERSION
2314
from octue.log_handlers import apply_log_handler, get_remote_handler
24-
from octue.resources import Child, Manifest, service_backends
25-
from octue.runner import Runner
15+
from octue.resources import Manifest
16+
from octue.twined.cloud.events.answer_question import answer_question
17+
from octue.twined.cloud.events.question import make_question_event
18+
from octue.twined.cloud.events.replayer import EventReplayer
19+
from octue.twined.cloud.events.validation import VALID_EVENT_KINDS
20+
from octue.twined.cloud.pub_sub.bigquery import DEFAULT_EVENT_STORE_TABLE_ID, get_events
21+
from octue.twined.cloud.pub_sub.service import Service
22+
from octue.twined.cloud.service_id import create_sruid, get_sruid_parts
23+
from octue.twined.configuration import ServiceConfiguration
24+
from octue.twined.definitions import MANIFEST_FILENAME, VALUES_FILENAME
25+
from octue.twined.exceptions import ServiceAlreadyExists
26+
from octue.twined.resources import Child, service_backends
27+
from octue.twined.runner import Runner
2628
from octue.utils.decoders import OctueJSONDecoder
2729
from octue.utils.encoders import OctueJSONEncoder
2830

@@ -193,7 +195,7 @@ def remote(sruid, input_values, input_manifest, project_id, asynchronous, servic
193195
def local(input_values, input_manifest, attributes, service_config):
194196
"""Ask a question to a local Octue Twined service.
195197
196-
This command is similar to running `octue start` and asking the resulting local service revision a question
198+
This command is similar to running `octue twined start` and asking the resulting local service revision a question
197199
via Pub/Sub. Instead of starting a local Pub/Sub service revision, however, no Pub/Sub subscription or subscriber is
198200
created; the question is instead passed directly to local the service revision without Pub/Sub being involved.
199201
Everything after this runs the same, though, with the service revision emitting any events via Pub/Sub as usual.

0 commit comments

Comments
 (0)