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

Remove the Subscriptions feature #1776

Merged
merged 8 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.0.0]
### Removed
- The Subscriptions feature has been removed.
- Removed the `/subscriptions` API endpoint.
- Removed the `subscription_id` query parameter from the `GET /jobs` API endpoint.
- Removed the `subscription_id` field from the response body of the `GET /jobs` API endpoint.

## [3.10.10]
### Changed
- Reduced vCPU limits for `hyp3-tibet-jpl` to 0 from 10,000.
Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@ API = ${PWD}/apps/api/src
CHECK_PROCESSING_TIME = ${PWD}/apps/check-processing-time/src
GET_FILES = ${PWD}/apps/get-files/src
HANDLE_BATCH_EVENT = ${PWD}/apps/handle-batch-event/src
SUBSCRIPTION_MANAGER = ${PWD}/apps/subscription-manager/src
SUBSCRIPTION_WORKER = ${PWD}/apps/subscription-worker/src
SCALE_CLUSTER = ${PWD}/apps/scale-cluster/src
START_EXECUTION_MANAGER = ${PWD}/apps/start-execution-manager/src
START_EXECUTION_WORKER = ${PWD}/apps/start-execution-worker/src
UPDATE_DB = ${PWD}/apps/update-db/src
UPLOAD_LOG = ${PWD}/apps/upload-log/src
DYNAMO = ${PWD}/lib/dynamo
export PYTHONPATH = ${API}:${CHECK_PROCESSING_TIME}:${GET_FILES}:${HANDLE_BATCH_EVENT}:${SUBSCRIPTION_MANAGER}:${SUBSCRIPTION_WORKER}:${SCALE_CLUSTER}:${START_EXECUTION_MANAGER}:${START_EXECUTION_WORKER}:${UPDATE_DB}:${UPLOAD_LOG}:${DYNAMO}
export PYTHONPATH = ${API}:${CHECK_PROCESSING_TIME}:${GET_FILES}:${HANDLE_BATCH_EVENT}:${SCALE_CLUSTER}:${START_EXECUTION_MANAGER}:${START_EXECUTION_WORKER}:${UPDATE_DB}:${UPLOAD_LOG}:${DYNAMO}


build: render
python -m pip install --upgrade -r requirements-apps-api.txt -t ${API}; \
python -m pip install --upgrade -r requirements-apps-api-binary.txt --platform manylinux2014_x86_64 --only-binary=:all: -t ${API}; \
python -m pip install --upgrade -r requirements-apps-handle-batch-event.txt -t ${HANDLE_BATCH_EVENT}; \
python -m pip install --upgrade -r requirements-apps-subscription-manager.txt -t ${SUBSCRIPTION_MANAGER}; \
python -m pip install --upgrade -r requirements-apps-subscription-worker.txt -t ${SUBSCRIPTION_WORKER}; \
python -m pip install --upgrade -r requirements-apps-scale-cluster.txt -t ${SCALE_CLUSTER}; \
python -m pip install --upgrade -r requirements-apps-start-execution-manager.txt -t ${START_EXECUTION_MANAGER}; \
python -m pip install --upgrade -r requirements-apps-start-execution-worker.txt -t ${START_EXECUTION_WORKER}; \
Expand All @@ -45,7 +41,7 @@ render:
static: flake8 openapi-validate cfn-lint

flake8:
flake8 --ignore=E731 --max-line-length=120 --import-order-style=pycharm --statistics --application-import-names hyp3_api,get_files,handle_batch_event,check_processing_time,start_execution_manager,start_execution_worker,update_db,upload_log,dynamo,lambda_logging,subscription_manager,subscription_worker,scale_cluster apps tests lib
flake8 --ignore=E731 --max-line-length=120 --import-order-style=pycharm --statistics --application-import-names hyp3_api,get_files,handle_batch_event,check_processing_time,start_execution_manager,start_execution_worker,update_db,upload_log,dynamo,lambda_logging,scale_cluster apps tests lib

openapi-validate: render
openapi-spec-validator apps/api/src/hyp3_api/api-spec/openapi-spec.yml
Expand Down
10 changes: 0 additions & 10 deletions apps/api/api-cf.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ Parameters:
UsersTable:
Type: String

SubscriptionsTable:
Type: String

AuthPublicKey:
Type: String

Expand Down Expand Up @@ -172,12 +169,6 @@ Resources:
Action:
- dynamodb:GetItem
Resource: !Sub "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${UsersTable}*"
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:Query
Resource: !Sub "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${SubscriptionsTable}*"

Lambda:
Type: AWS::Lambda::Function
Expand All @@ -186,7 +177,6 @@ Resources:
Variables:
JOBS_TABLE_NAME: !Ref JobsTable
USERS_TABLE_NAME: !Ref UsersTable
SUBSCRIPTIONS_TABLE_NAME: !Ref SubscriptionsTable
AUTH_PUBLIC_KEY: !Ref AuthPublicKey
AUTH_ALGORITHM: !Ref AuthAlgorithm
MONTHLY_JOB_QUOTA_PER_USER: !Ref MonthlyJobQuotaPerUser
Expand Down
31 changes: 0 additions & 31 deletions apps/api/src/hyp3_api/api-spec/job_parameters.yml.j2
jtherrmann marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ components:
- $ref: "#/components/schemas/{{ job_type }}Parameters"
{% endfor %}

job_specification:
oneOf:
{% for job_type in job_types %}
- $ref: "#/components/schemas/{{ job_type }}Specification"
{% endfor %}

{% for job_type, job_spec in job_types.items() %}
{{ job_type }}Parameters:
description: Parameters for running {{ job_type }} jobs, including specific granules
Expand Down Expand Up @@ -63,29 +57,4 @@ components:
job_parameters:
$ref: "#/components/schemas/{{ job_type }}Parameters"

{{ job_type }}Specification:
description: Contains user provided information on creating a new {{ job_type }} subscription, without specific granules.
type: object
additionalProperties: false
required:
- job_type
- name
properties:
job_type:
type: string
enum:
- {{ job_type }}
name:
$ref: "./openapi-spec.yml#components/schemas/name"
job_parameters:
type: object
additionalProperties: false
{% for parameter, parameter_spec in job_spec['parameters'].items() if 'api_schema' in parameter_spec and parameter not in job_spec.get('required_parameters', []) %}
{% if loop.first %}
properties:
{% endif %}
{{ parameter }}:
{{ json.dumps(parameter_spec[ 'api_schema' ]) }}
{% endfor %}

{% endfor %}
174 changes: 4 additions & 170 deletions apps/api/src/hyp3_api/api-spec/openapi-spec.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ paths:
in: query
schema:
$ref: "#/components/schemas/start_token"
- name: subscription_id
in: query
schema:
$ref: "#/components/schemas/job_or_subscription_id"

responses:
"200":
Expand All @@ -78,7 +74,7 @@ paths:
- name: job_id
in: path
schema:
$ref: "#/components/schemas/job_or_subscription_id"
$ref: "#/components/schemas/job_id"
required: true

responses:
Expand All @@ -100,94 +96,6 @@ paths:
schema:
$ref: "#/components/schemas/user"

/subscriptions:
post:
description: Adds a subscription with search criteria and processing parameters to use to process data as it becomes available
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/subscriptions_body"
required: true
responses:
"200":
description: 200 response
content:
application/json:
schema:
type: object
properties:
subscription:
$ref: "#/components/schemas/subscription"
validate_only:
$ref: "#/components/schemas/validate_only"


get:
description: Get information about subscriptions for the logged in user
parameters:
- name: name
in: query
schema:
$ref: "#/components/schemas/name"
- name: job_type
in: query
schema:
$ref: "./job_parameters.yml#components/schemas/job_type"
- name: enabled
in: query
schema:
$ref: "#/components/schemas/subscription_enabled"
responses:
"200":
description: 200 response
content:
application/json:
schema:
type: object
required:
- subscriptions
properties:
subscriptions:
$ref: "#/components/schemas/list_of_subscriptions"
/subscriptions/{subscription_id}:
patch:
description: Change information about the given subscription
parameters:
- name: subscription_id
in: path
schema:
$ref: "#/components/schemas/job_or_subscription_id"
required: true
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/subscriptions_update_expression'
required: true
responses:
"200":
description: 200 response
content:
application/json:
schema:
$ref: "#/components/schemas/subscription"
get:
description: Get information about a specific subscription
parameters:
- name: subscription_id
in: path
schema:
$ref: "#/components/schemas/job_or_subscription_id"
required: true
responses:
"200":
description: 200 response
content:
application/json:
schema:
$ref: "#/components/schemas/subscription"

components:
schemas:

Expand Down Expand Up @@ -217,74 +125,6 @@ components:
next:
$ref: "#/components/schemas/next_url"

subscriptions_body:
description: Information about a subscription
type: object
required:
- subscription
additionalProperties: false
properties:
validate_only:
$ref: "#/components/schemas/validate_only"
subscription:
$ref: "#/components/schemas/new_subscription"

new_subscription:
description: Contains user provided information about a new subscription
type: object
required:
- search_parameters
- job_specification
additionalProperties: false
properties:
search_parameters:
$ref: "#/components/schemas/search_parameters"
job_specification:
$ref: "./job_parameters.yml#components/schemas/job_specification"

subscriptions_update_expression:
description: Change/update a subscription
type: object
additionalProperties: false
properties:
start:
$ref: "#/components/schemas/datetime"
end:
$ref: "#/components/schemas/datetime"
intersectsWith:
$ref: "#/components/schemas/intersectsWith"
enabled:
$ref: "#/components/schemas/subscription_enabled"

list_of_subscriptions:
type: array
items:
$ref: "#/components/schemas/subscription"

subscription:
type: object
required:
- subscription_id
- search_parameters
- job_specification
- user_id
- creation_date
- enabled
additionalProperties: false
properties:
subscription_id:
$ref: "#/components/schemas/job_or_subscription_id"
search_parameters:
$ref: "#/components/schemas/search_parameters"
job_specification:
$ref: "./job_parameters.yml#components/schemas/job_specification"
user_id:
$ref: "#/components/schemas/user_id"
creation_date:
$ref: "#/components/schemas/datetime"
enabled:
$ref: "#/components/schemas/subscription_enabled"

user:
description: Information about a user (quota, user id)
type: object
Expand Down Expand Up @@ -410,9 +250,7 @@ components:
additionalProperties: false
properties:
job_id:
$ref: "#/components/schemas/job_or_subscription_id"
subscription_id:
$ref: "#/components/schemas/job_or_subscription_id"
$ref: "#/components/schemas/job_id"
user_id:
$ref: "#/components/schemas/user_id"
job_type:
Expand Down Expand Up @@ -447,8 +285,8 @@ components:
type: boolean
default: false

job_or_subscription_id:
description: Unique identifier for a job or subscription
job_id:
description: Unique identifier for a job
type: string
format: uuid
example: 27836b79-e5b2-4d8f-932f-659724ea02c3
Expand All @@ -458,10 +296,6 @@ components:
type: string
example: myUserId

subscription_enabled:
description: Set to false to pause/disable the processing of new data.
type: boolean

datetime:
description: Date and time object formatted according to ISO 8601
type: string
Expand Down
Loading