Skip to content

Commit a6584c4

Browse files
authored
MRG: Merge pull request #598 from octue/improve-monitor-message-tests
Remove dataflow deployment CLI command
2 parents b49957d + f5f9767 commit a6584c4

24 files changed

+572
-2469
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
// Use 'postCreateCommand' to run commands after the container is created
6161
// TODO update this to install all extras once https://github.com/python-poetry/poetry/issues/3413 is solved
62-
"postCreateCommand": "poetry install --extras hdf5 --extras dataflow",
62+
"postCreateCommand": "poetry install --extras hdf5",
6363

6464
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
6565
"remoteUser": "vscode",

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ jobs:
7171
runs-on: ubuntu-latest
7272
needs: run-tests
7373
steps:
74-
- uses: actions/checkout@v3
75-
7674
- name: Create Release
7775
uses: actions/create-release@v1
7876
env:
Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
# This workflow updates the pull request description with an auto-generated section containing the categorised commit
2-
# message headers of the commits since the last pull request merged into main. The auto generated section is enveloped
3-
# between two comments: "<!--- START AUTOGENERATED NOTES --->" and "<!--- END AUTOGENERATED NOTES --->". Anything
4-
# outside these in the description is left untouched. Auto-generated updates can be skipped for a commit if
2+
# message headers of the pull request's commits. The auto generated section is enveloped between two comments:
3+
# "<!--- START AUTOGENERATED NOTES --->" and "<!--- END AUTOGENERATED NOTES --->". Anything outside these in the
4+
# description is left untouched. Auto-generated updates can be skipped for a commit if
55
# "<!--- SKIP AUTOGENERATED NOTES --->" is added to the pull request description.
66

77
name: update-pull-request
88

9-
# Only trigger for pull requests into main branch.
10-
on:
11-
pull_request:
12-
branches:
13-
- main
9+
on: pull_request
1410

1511
jobs:
1612
description:
1713
if: "!contains(github.event.pull_request.body, '<!--- SKIP AUTOGENERATED NOTES --->')"
1814
runs-on: ubuntu-latest
1915
steps:
20-
- uses: actions/checkout@v3
21-
- uses: octue/generate-pull-request-description@1.0.0.beta-2
22-
id: pr-description
23-
with:
24-
pull_request_url: ${{ github.event.pull_request.url }}
25-
api_token: ${{ secrets.GITHUB_TOKEN }}
26-
- name: Update pull request body
27-
uses: riskledger/update-pr-description@v2
28-
with:
29-
body: ${{ steps.pr-description.outputs.pull_request_description }}
30-
token: ${{ secrets.GITHUB_TOKEN }}
16+
- uses: octue/[email protected]
17+
id: pr-description
18+
with:
19+
pull_request_url: ${{ github.event.pull_request.url }}
20+
api_token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Update pull request body
23+
uses: riskledger/update-pr-description@v2
24+
with:
25+
body: ${{ steps.pr-description.outputs.pull_request_description }}
26+
token: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ RUN poetry config virtualenvs.create false
1010
# Install python dependencies. Note that poetry installs any root packages by default, but this is not available at this
1111
# stage of caching dependencies. So we do a dependency-only install here to cache the dependencies, then a full poetry
1212
# install post-create to install the root package, which will change more rapidly than dependencies.
13-
COPY octue/cloud/deployment/google/dataflow/setup.py setup.py
1413
COPY pyproject.toml poetry.lock ./
15-
RUN poetry install --no-ansi --no-interaction -E dataflow --only=main --no-root -v
14+
RUN poetry install --no-ansi --no-interaction --only=main --no-root -v
1615

1716
COPY . .
18-
RUN poetry install --no-ansi --no-interaction -E dataflow --only=main -v
17+
RUN poetry install --no-ansi --no-interaction --only=main -v

docs/source/creating_services.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ One of the main features of the Octue SDK is to allow you to easily create servi
55
return answers. They can run locally on any machine or be deployed to the cloud. Currently:
66

77
- The backend communication between twins uses Google Pub/Sub whether they're local or deployed
8-
- The deployment options are Google Cloud Run or Google Dataflow
8+
- Services are deployed to Google Cloud Run
99
- The language of the entrypoint must by ``python3`` (you can call processes using other languages within this though)
1010

1111

@@ -96,7 +96,6 @@ Dockerfile (optional)
9696
provides a default ``Dockerfile`` for these purposes that will work for most cases:
9797

9898
- For deploying to `Google Cloud Run <https://github.com/octue/octue-sdk-python/blob/main/octue/cloud/deployment/google/cloud_run/Dockerfile>`_
99-
- For deploying to `Google Dataflow <https://github.com/octue/octue-sdk-python/blob/main/octue/cloud/deployment/google/dataflow/Dockerfile>`_
10099

101100
However, you may need to write and provide your own ``Dockerfile`` if your app requires:
102101

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Key features
4040
**Create, run, and deploy your apps as services**
4141

4242
- No need to change your app - just wrap it
43-
- Use the ``octue`` CLI to run your service locally or deploy it to Google Cloud Run or Google Dataflow
43+
- Use the ``octue`` CLI to run your service locally or deploy it to Google Cloud Run
4444
- Create JSON-schema interfaces to explicitly define the form of configuration, input, and output data
4545
- Ask other services questions as part of your app (i.e. build trees of services)
4646
- Automatically display readable, colourised logs, or use your own log handler

docs/source/inter_service_compatibility.rst

Lines changed: 163 additions & 161 deletions
Large diffs are not rendered by default.

octue/cli.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -349,53 +349,7 @@ def get_crash_diagnostics(cloud_path, local_path, download_datasets):
349349

350350
@octue_cli.group()
351351
def deploy():
352-
"""Deploy a python app to the cloud as an Octue service or digital twin."""
353-
354-
355-
@deploy.command()
356-
@click.option(
357-
"-c",
358-
"--service-config",
359-
type=click.Path(exists=True, dir_okay=False),
360-
default="octue.yaml",
361-
show_default=True,
362-
help="The path to an `octue.yaml` file defining the service to deploy.",
363-
)
364-
@click.option("--no-cache", is_flag=True, help="If provided, don't use the Docker cache when building the image.")
365-
@click.option("--update", is_flag=True, help="If provided, allow updates to an existing service.")
366-
@click.option(
367-
"--dataflow-job-only",
368-
is_flag=True,
369-
help="If provided, skip creating and running the build trigger and just deploy a pre-built image to Dataflow",
370-
)
371-
@click.option("--image-uri", type=str, default=None, help="The actual image URI to use when creating the Dataflow job.")
372-
@click.option(
373-
"--revision-tag",
374-
type=str,
375-
default=None,
376-
help="A tag to use for this revision of the service (e.g. 1.3.7). This overrides the `OCTUE_SERVICE_REVISION_TAG` "
377-
"environment variable if it's present. If this option isn't given and the environment variable isn't present, a "
378-
"random 'cool name' tag is generated e.g 'curious-capybara'.",
379-
)
380-
def dataflow(service_config, no_cache, update, dataflow_job_only, image_uri, revision_tag):
381-
"""Deploy a python app to Google Dataflow as an Octue service or digital twin."""
382-
if bool(importlib.util.find_spec("apache_beam")):
383-
# Import the Dataflow deployer only if the `apache-beam` package is available (due to installing `octue` with
384-
# the `dataflow` extras option).
385-
from octue.cloud.deployment.google.dataflow.deployer import DataflowDeployer
386-
else:
387-
raise ImportWarning(
388-
"To use this CLI command, you must install `octue` with the `dataflow` option e.g. "
389-
"`pip install octue[dataflow]`"
390-
)
391-
392-
deployer = DataflowDeployer(service_config, revision_tag=revision_tag)
393-
394-
if dataflow_job_only:
395-
deployer.create_streaming_dataflow_job(image_uri=image_uri, update=update)
396-
return
397-
398-
deployer.deploy(no_cache=no_cache, update=update)
352+
"""A collection of commands to aid deploying a python app to the cloud as an Octue service or digital twin."""
399353

400354

401355
@deploy.command()

0 commit comments

Comments
 (0)