-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add catalog-info for backstage (#137)
* rebased * added a catalog info and openapi schema * renamed rest -> service as files have changed location * removed outdated test_rest_api.py file * modified catalog-info to include asyncapi, and made openapi.py output openapi.json into the same location as asyncapi.yaml * removed catalog-info.yaml from pre commit checks to pass linting * added CI job to automatically run openapi.py script to generate openapi schema * changed name of CI job for openapi * added test for openapi.py * added openapi schema in docs * using sphinxcontrib.openapi to autogenerate open api documentation * added dependency to pyproject.toml
- Loading branch information
1 parent
efecc7a
commit 6230cc2
Showing
10 changed files
with
492 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Openapi | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
# Run weekly to check latest versions of dependencies | ||
- cron: "0 8 * * WED" | ||
env: | ||
# The target python version, which must match the Dockerfile version | ||
CONTAINER_PYTHON: "3.11" | ||
|
||
jobs: | ||
publish: | ||
# pull requests are a duplicate of a branch push if within the same repo. | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install python packages | ||
uses: ./.github/actions/install_requirements | ||
with: | ||
requirements_file: requirements-dev-3.x.txt | ||
install_options: -e .[dev] | ||
|
||
- name: generate openapi schema | ||
run: python src/blueapi/service/openapi.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: bluesky-worker | ||
title: bluesky-worker | ||
description: Lightweight wrapper around bluesky services | ||
annotations: | ||
github.com/project-slug: DiamondLightSouce/blueapi | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:vid18871 # TODO: owner: DAQ-Core | ||
# system: Athena # TODO: Define Athena system: presumably same location as DAQ-Core/DAQ? | ||
providesApis: | ||
- message-topics | ||
- restapi | ||
- blueskydocument-to-scanmessage | ||
--- | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: API | ||
metadata: | ||
name: restapi | ||
title: restapi | ||
description: REST API for getting plans/devices from the worker (and running tasks) | ||
spec: | ||
type: openapi | ||
lifecycle: production | ||
owner: user:vid18871 | ||
definition: | ||
$text: ./docs/user/reference/openapi.json | ||
--- | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: API | ||
metadata: | ||
name: message-topics | ||
title: message-topics | ||
description: Message topics which can be listened to over an activeMQ message bus | ||
spec: | ||
type: asyncapi | ||
lifecycle: production | ||
owner: user:vid18871 | ||
definition: | ||
$text: ./docs/user/reference/asyncapi.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ side-bar. | |
|
||
reference/api | ||
reference/asyncapi | ||
reference/openapi | ||
../genindex | ||
|
||
+++ | ||
|
Oops, something went wrong.