Skip to content

Commit

Permalink
INF-465: Cloud Endpoints Portal Deprecation - move observatory-api co…
Browse files Browse the repository at this point in the history
…ntainer (#610)
  • Loading branch information
alexmassen-hane authored Mar 22, 2023
1 parent 914eb0b commit cc681d6
Show file tree
Hide file tree
Showing 32 changed files with 155 additions and 855 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/build-observatory-api.yml

This file was deleted.

8 changes: 0 additions & 8 deletions docs/tutorials/deploy_terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,6 @@ Terraform config file: in this case you will need to update the Terraform worksp
* You have changed any other settings in the Observatory Terraform config file (apart from `backend.environment`):
in this case you will need to update the Terraform workspace variables and run `terraform apply`.

## Building the Cloud Run image
The Docker image for the API needs to be uploaded to the Google Cloud container registry. This is used to create the
Cloud Run backend service, to build the Docker image run the following command:
```bash
observatory terraform build-api-image ~/.observatory/config-terraform.yaml
```

Use this command if:
* This is the first time you are deploying the Terraform resources
* You have updated any files in the API directory (`/home/user/workspace/observatory-platform/observatory-platform/observatory/platform/api`)
Expand Down Expand Up @@ -340,7 +333,6 @@ Terraform Cloud Workspace:
* airflow: sensitive
* google_cloud: sensitive
* cloud_sql_database: sensitive
* api: {"domain_name"="api.observatory.academy","subdomain"="project_id"}
* airflow_main_vm: {"machine_type"="n2-standard-2","disk_size"=20,"disk_type"="pd-standard","create"=true}
* airflow_worker_vm: {"machine_type"="n2-standard-2","disk_size"=20,"disk_type"="pd-standard","create"=false}
* airflow_variables: {}
Expand Down
42 changes: 0 additions & 42 deletions observatory-api/Dockerfile

This file was deleted.

5 changes: 2 additions & 3 deletions observatory-api/observatory/api/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ def cli():
@cli.command()
@click.argument("template-file", type=click.Path(exists=True, file_okay=True, dir_okay=False))
@click.argument("output-file", type=click.Path(exists=False, file_okay=True, dir_okay=False))
@click.option("--cloud-endpoints", is_flag=True, default=False, help="Generate OpenAPI config for Cloud Endpoints.")
@click.option(
"--api-client", is_flag=True, default=False, help="Generate OpenAPI config for OpenAPI client generation."
)
def generate_openapi_spec(template_file, output_file, cloud_endpoints, api_client):
def generate_openapi_spec(template_file, output_file, api_client):
"""Generate an OpenAPI specification for the Observatory API.\n
TEMPLATE_FILE: the type of config file to generate.
OUTPUT_FILE: the type of config file to generate.
"""

# Render file
renderer = OpenApiRenderer(template_file, cloud_endpoints=cloud_endpoints, api_client=api_client)
renderer = OpenApiRenderer(template_file, api_client=api_client)
render = renderer.render()

# Save file
Expand Down
2 changes: 1 addition & 1 deletion observatory-api/observatory/api/server/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ def create_app() -> connexion.App:

# Add the OpenAPI specification
specification_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "openapi.yaml.jinja2")
builder = OpenApiRenderer(specification_path, cloud_endpoints=False)
builder = OpenApiRenderer(specification_path)
specification = builder.to_dict()
conn_app.add_api(specification)

Expand Down
Loading

0 comments on commit cc681d6

Please sign in to comment.