Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update docs #16

Merged
merged 32 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
23488bd
updating documentation
Charlie-Farrar Jul 19, 2023
3479ec2
table formatting for analysis_settings_schema
Charlie-Farrar Jul 19, 2023
51f7e1a
table updates for json schemas
Charlie-Farrar Jul 19, 2023
3b8e833
post lost amplification documentation updates
Charlie-Farrar Jul 21, 2023
b65aecd
updating formatting
Charlie-Farrar Jul 21, 2023
0986020
added direct link to github
Charlie-Farrar Jul 21, 2023
ca2c93f
updating documentation
Charlie-Farrar Jul 24, 2023
19ab869
renaming github section
Charlie-Farrar Jul 24, 2023
af7ad41
grammar updates
Charlie-Farrar Jul 24, 2023
4c62d5d
deployment options section format update
Charlie-Farrar Jul 24, 2023
6290b8e
change link in ktools section
Charlie-Farrar Jul 24, 2023
c93c713
updating formatting
Charlie-Farrar Jul 24, 2023
89a3e54
updating documentation for ODS and UI
Charlie-Farrar Jul 25, 2023
89fc998
removing unnecessary commands
Charlie-Farrar Jul 25, 2023
384f910
updating index format
Charlie-Farrar Jul 25, 2023
5809d10
making logo link to github
Charlie-Farrar Jul 26, 2023
08118f2
Feature/redoc schema (#13)
sambles Jul 26, 2023
085538b
link redoc test
Charlie-Farrar Jul 26, 2023
c434bfc
remove duplicate extension
Charlie-Farrar Jul 27, 2023
3ef85ee
test sphinx-contrib/redoc (#14)
sambles Jul 27, 2023
de95c6b
clean up
Charlie-Farrar Jul 27, 2023
66efd35
first draft correlation
johcarter Jul 27, 2023
8f59fd8
correlation updates
johcarter Jul 27, 2023
53c54be
correlation updates 2
johcarter Jul 27, 2023
8713a85
updating content in Key Service and Financial Module sections
Charlie-Farrar Jul 28, 2023
f468146
adding correlation section to sidebar
Charlie-Farrar Jul 28, 2023
df0df9f
remove old model-settings section
Charlie-Farrar Jul 31, 2023
0fd0c1b
fix link to new schema sections
Charlie-Farrar Jul 31, 2023
92fcceb
add versioning section
Charlie-Farrar Jul 31, 2023
bd79ba7
link through from API to schema sections
Charlie-Farrar Jul 31, 2023
2754a64
schema to sphinx page link test
Charlie-Farrar Jul 31, 2023
9a49a93
schema to sphinx page link test
Charlie-Farrar Jul 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/html
repository-name: OasisLMF.github.io
repository-name: OasisLMF/OasisLMF.github.io
token: ${{ secrets.BUILD_DEPLOY_TOKEN }}
55 changes: 55 additions & 0 deletions .github/workflows/project-PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Add PR to project
on:
pull_request:
types:
- opened
jobs:
track_pr:
runs-on: ubuntu-latest
steps:
- name: Get project data
env:
GITHUB_TOKEN: ${{ secrets.PROJECT_ACCESS_TOKEN }}
ORGANIZATION: Oasislmf
PROJECT_NUMBER: 44
run: |
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectV2(number: $number) {
id
fields(first:20) {
nodes {
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json

echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV

- name: Add PR to project
env:
GITHUB_TOKEN: ${{ secrets.PROJECT_ACCESS_TOKEN }}
PR_ID: ${{ github.event.pull_request.node_id }}
run: |
item_id="$( gh api graphql -f query='
mutation($project:ID!, $pr:ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $pr}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectV2ItemById.projectV2Item.id')"
55 changes: 55 additions & 0 deletions .github/workflows/project-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Add issue to project
on:
issues:
types:
- opened
jobs:
track_issue:
runs-on: ubuntu-latest
steps:
- name: Get project data
env:
GITHUB_TOKEN: ${{ secrets.PROJECT_ACCESS_TOKEN }}
ORGANIZATION: Oasislmf
PROJECT_NUMBER: 44
run: |
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectV2(number: $number) {
id
fields(first:20) {
nodes {
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json

echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV

- name: Add issue to project
env:
GITHUB_TOKEN: ${{ secrets.PROJECT_ACCESS_TOKEN }}
ISSUE_ID: ${{ github.event.issue.node_id }}
run: |
item_id="$( gh api graphql -f query='
mutation($project:ID!, $issue:ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectV2ItemById.projectV2Item.id')"
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ set -e
# exit 1
#fi

# Update JSON specs
./update-redoc.py

# Build docs
cd $DIR_BASE
make html SPHINXBUILD="python ${DIR_ENV}/bin/sphinx-build"
Expand All @@ -72,3 +75,5 @@ set -e
fi
tar -czvf oasis_docs.tar.gz -C build/html/ .
mv oasis_docs.tar.gz $DIR_BASE/output/


1 change: 1 addition & 0 deletions redoc/analysis_settings/analysis_schema.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions redoc/analysis_settings/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Analysis Settings Overview

The run time settings for the analysis are controlled by the `analysis_settings.json` file which is a user supplied file detailing all of the options requested for the run (model to run, exposure set to use, number of samples, occurrence options, outputs required, etc.). In the MDK, the analysis settings file must be specified as part of the command line arguments (or in the oasislmf.json configuration file) and in the platform, it needs to be posted to the endpoint. A full json schema for the available options in the analysis settings file can be found here:

https://github.com/OasisLMF/ODS_Tools/blob/develop/ods_tools/data/analysis_settings_schema.json

This is useful for more technical users who are looking to create their own UI or integrate Oasis with an existing system. The `analysis_settings` schema hierarchy is shown in `json` format in right column of the page. An interactive version of the schema, with descriptions and examples, can be found below:
39 changes: 39 additions & 0 deletions redoc/analysis_settings/redoc_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"openapi": "3.0.0",
"info": {
"title": "ODS Analysis Settings",
"description": "<TEXT HERE>",
"version": "<ODS_VERSION>",
"x-logo": {
"url": "https://oasislmf.github.io/_static/OASIS_LMF_COLOUR.png",
"backgroundColor": "#FFFFFF",
"altText": "OasisLMF logo"
}
},
"tags": [
{
"name": "analysis_settings",
"x-displayName": "Analysis Settings Schema",
"description": "<SchemaDefinition schemaRef=\"#/definitions/AnalysisSettings\" />"
},
{
"name": "landing_page_link",
"x-displayName": "Back to landing page",
"externalDocs": {
"url": "http://oasislmf.github.io/",
"description": "Click here to go back to the landing page"
}
}
],
"x-tagGroups": [{
"name": "JSON Schema",
"tags": [
"landing_page_link",
"analysis_settings"
]
}],

"definitions": {
"AnalysisSettings": {}
}
}
7 changes: 7 additions & 0 deletions redoc/model_settings/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Model Settings Overview

This is a configuration file provided with the model to specify important meta data about the model to model users and systems. It is supplied by the model provider and is a static document. A full specification of the `model_settings` schema can be found here:

https://github.com/OasisLMF/ODS_Tools/blob/main/ods_tools/data/model_settings_schema.json

This is useful for more technical users who are looking to create their own UI or integrate Oasis with an existing system. The `model_settings` schema hierarchy is shown in `json` format in right column of the page. An interactive version of the schema, with descriptions and examples, can be found below:
1 change: 1 addition & 0 deletions redoc/model_settings/model_schema.json

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions redoc/model_settings/redoc_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"openapi": "3.0.0",
"info": {
"title": "ODS Model Settings",
"description": "<TEXT HERE>",
"version": "<ODS_VERSION>",
"x-logo": {
"url": "https://oasislmf.github.io/_static/OASIS_LMF_COLOUR.png",
"backgroundColor": "#FFFFFF",
"altText": "OasisLMF logo"
}
},

"tags": [
{
"name": "model_settings",
"x-displayName": "Model Settings Schema",
"description": "<SchemaDefinition schemaRef=\"#/definitions/ModelParameters\" />"
},
{
"name": "landing_page_link",
"x-displayName": "Back to landing page",
"externalDocs": {
"url": "http://oasislmf.github.io/",
"description": "Click here to go back to the landing page"
}
}
],
"x-tagGroups": [{
"name": "JSON Schema",
"tags": [
"landing_page_link",
"model_settings"
]
}],

"definitions": {
"ModelParameters": {}
}
}
65 changes: 65 additions & 0 deletions redoc/v1/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Introduction

Oasis has a full REST API for managing exposure data and operating
modelling workflows. API Swagger documentation can be found
[here](http://api.oasislmfdev.org/swagger/). An evaluation version of
the Oasis platform and using can be deployed using the [Oasis evaluation
repository](https://github.com/OasisLMF/OasisEvaluation). This includes
a Jupyter notebook that illustrates the basic operation of the API,
using the Python API client.

# Oasis API

The Oasis Platform release now includes a full API for operating
catastrophe models and a general consolidation of the platform
architecture. Windows SQL server is no longer a strict requirement. The
platform can be run via docker containers on a single machine or, if
required, scaled up to run on a cluster.

Docker support is the main requirement for running the platform. A Linux
based installation is the main focus of this example deployment. Running
the install script from this repository automates install process of the
**OasisPlatform API v1**, User Interface and example PiWind model.

The **Oasis API** is the components of the Oasis platform that manages
all the elements of the plaform that are required to build, run, and
test models. The diagram below shows how the **Oasis API** sits behind
the [Oasis-UI](https://oasislmf.github.io/sections/Oasis-UI.html)
you use to operate your catastrophe models.

*Oasis docker componets*:

<img src="https://raw.githubusercontent.com/OasisLMF/GenerateDocs/feature/update_docs/src/images/oasis_containers.png" alt="Oasis docker componets" style="align-center; width:600px;"/>

# API deployment in the Oasis Enterprise Platform

The **Oasis Enterprise Platform** is supported by the **OasisPlatform API v2**, and is an open source
[Kubernetes](https://kubernetes.io/docs/concepts/overview/) based, cloud
computing cluster, which is deployable in [Microsoft Azure](https://azure.microsoft.com/en-gb/resources/cloud-computing-dictionary/what-is-azure/) via
[Helm charts](https://helm.sh/docs/topics/charts/) and [Bicep scripts](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deployment-script-bicep)
to setup the Azure cloud services. The diagram below sets out the

**Oasis Enterprise Platform** architecture:

<img src="https://raw.githubusercontent.com/OasisLMF/GenerateDocs/feature/update_docs/src/images/diag_oasis_components.png" alt="Oasis Enterprise Platform Architecture" style="align-center; width:600px;"/>

# Links for further information

There is more information availible in the [Oasis GitHub](https://github.com/OasisLMF).

This includes detailed walkthorughs on:

1. Oasis implementation of [Microsoft Azure](https://azure.microsoft.com/en-gb/resources/cloud-computing-dictionary/what-is-azure/).
2. How to implement [Kubernetes](https://kubernetes.io/docs/concepts/overview/).
3. How to deploy and manage the Oasis platform on a [Kubernetes](https://kubernetes.io/docs/concepts/overview/) cluster.

# Oasis API v1 schema

A full json schema for the available options in the v1 API file can be found here:

https://github.com/OasisLMF/OasisPlatform/releases/download/1.28.0/openapi-schema-1.28.0.json

This is useful for more technical users who are looking to create their own UI or integrate Oasis with an existing system. The v1 schema hierarchy is shown in `json` format in right column of the page. An interactive version of the schema, with descriptions and examples, can be found below:

***NOTE:***
***This link may not be the most up to date version of the schema. Please check what the latest version of OasisPlatform is, and amend the link accordingly.***
1 change: 1 addition & 0 deletions redoc/v1/oasis-platform-schema.json

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions redoc/v2/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Introduction

Oasis has a full REST API for managing exposure data and operating
modelling workflows. API Swagger documentation can be found
[here](http://api.oasislmfdev.org/swagger/). An evaluation version of
the Oasis platform and using can be deployed using the [Oasis evaluation
repository](https://github.com/OasisLMF/OasisEvaluation). This includes
a Jupyter notebook that illustrates the basic operation of the API,
using the Python API client.

# Oasis API

The Oasis Platform release now includes a full API for operating
catastrophe models and a general consolidation of the platform
architecture. Windows SQL server is no longer a strict requirement. The
platform can be run via docker containers on a single machine or, if
required, scaled up to run on a cluster.

Docker support is the main requirement for running the platform. A Linux
based installation is the main focus of this example deployment. Running
the install script from this repository automates install process of the
**OasisPlatform API v1**, User Interface and example PiWind model.

The **Oasis API** is the components of the Oasis platform that manages
all the elements of the plaform that are required to build, run, and
test models. The diagram below shows how the **Oasis API** sits behind
the `Oasis-UI`{.interpreted-text role="doc"}, that you use to operate
your catastrophe models.

*Oasis docker componets*:

<img src="https://raw.githubusercontent.com/OasisLMF/GenerateDocs/feature/update_docs/src/images/oasis_containers.png" alt="Oasis docker componets" style="align-center; width:600px;"/>


# API deployment in the Oasis Enterprise Platform

The **Oasis Enterprise Platform** is supported by the **OasisPlatform API v2**, and is an open source
[Kubernetes](https://kubernetes.io/docs/concepts/overview/) based, cloud
computing cluster, which is deployable in [Microsoft Azure](https://azure.microsoft.com/en-gb/resources/cloud-computing-dictionary/what-is-azure/) via
[Helm charts](https://helm.sh/docs/topics/charts/) and [Bicep scripts](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deployment-script-bicep)
to setup the Azure cloud services. The diagram below sets out the

**Oasis Enterprise Platform** architecture:

<img src="https://raw.githubusercontent.com/OasisLMF/GenerateDocs/feature/update_docs/src/images/diag_oasis_components.png" alt="Oasis Enterprise Platform Architecture" style="align-center; width:600px;"/>

# Links for further information

There is more information availible in the [Oasis GitHub](https://github.com/OasisLMF).

This includes detailed walkthorughs on:

1. Oasis implementation of [Microsoft Azure](https://azure.microsoft.com/en-gb/resources/cloud-computing-dictionary/what-is-azure/).
2. How to implement [Kubernetes](https://kubernetes.io/docs/concepts/overview/).
3. How to deploy and manage the Oasis platform on a [Kubernetes](https://kubernetes.io/docs/concepts/overview/) cluster.

# Oasis API v2 schema

A full json schema for the available options in the v2 API file can be found here:

https://github.com/OasisLMF/OasisPlatform/releases/download/2.2.0/openapi-schema-2.2.0.json

This is useful for more technical users who are looking to create their own UI or integrate Oasis with an existing system. The v2 schema hierarchy is shown in `json` format in right column of the page. An interactive version of the schema, with descriptions and examples, can be found below:

***NOTE:***
***This link may not be the most up to date version of the schema. Please check what the latest version of OasisPlatform is, and amend the link accordingly.***
1 change: 1 addition & 0 deletions redoc/v2/oasis-platform-schema.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ docutils
furo
sphinxcontrib-youtube
virtualenv
sphinx-jsonschema==1.19.1
requests
ods-tools
sphinxcontrib-redoc
Binary file modified src/.DS_Store
Binary file not shown.
Loading