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

Release v6.0.0 #2055

Merged
merged 144 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
943c377
Create deploy-credits-sandbox.yml
jtherrmann Jan 17, 2024
9037514
pseudocode implementing credit system for POST /jobs API endpoint
asjohnston-asf Jan 19, 2024
c12aca2
implement create_user and decrement_credits
jtherrmann Jan 19, 2024
58718d4
update api spec with new credits schema
asjohnston-asf Jan 19, 2024
f134d57
delete obsolete dynamo.jobs tests
jtherrmann Jan 19, 2024
61c21a4
Merge branch 'credit-futzing' of github.com:ASFHyP3/hyp3 into credit-…
jtherrmann Jan 19, 2024
85dd723
add todo
jtherrmann Jan 19, 2024
85edf3b
delete obsolete dynamo.user tests
jtherrmann Jan 19, 2024
14f93d1
upate get_user handler for new user schema
asjohnston-asf Jan 19, 2024
2c5b802
fix typo
asjohnston-asf Jan 19, 2024
35d334d
address setting priority for first job in batch
asjohnston-asf Jan 19, 2024
17a2ded
more priority refactoring
asjohnston-asf Jan 19, 2024
a65c8e6
fix some key errors
jtherrmann Jan 19, 2024
cbc48e7
Merge branch 'credit-futzing' of github.com:ASFHyP3/hyp3 into credit-…
jtherrmann Jan 19, 2024
3b078b8
decimals
jtherrmann Jan 19, 2024
ef6ecce
pass user_id to decrement_credits
jtherrmann Jan 19, 2024
7d81e73
test for dynamo.user.create_user
asjohnston-asf Jan 19, 2024
7a3e8c6
fix test_put_jobs
jtherrmann Jan 19, 2024
5426de4
add test for dynamo.user.decrement_credits
asjohnston-asf Jan 19, 2024
7be1ee0
Merge branch 'credit-futzing' of github.com:ASFHyP3/hyp3 into credit-…
asjohnston-asf Jan 19, 2024
21b41be
rename MONTHLY_JOB_QUOTA_PER_USER to DEFAULT_CREDITS_PER_USER
jtherrmann Jan 19, 2024
09829be
Merge branch 'credit-futzing' of github.com:ASFHyP3/hyp3 into credit-…
jtherrmann Jan 19, 2024
51652a6
update test for api GET /user endpoint
asjohnston-asf Jan 19, 2024
9791c42
merge upstream changes
asjohnston-asf Jan 19, 2024
2f8ffb2
rename MonthlyJobQuotaPerUser to DefaultCreditsPerUser
jtherrmann Jan 19, 2024
683aa19
rename quota to default_credits_per_user in deploy matrix
jtherrmann Jan 19, 2024
1fc0191
improve docstring
jtherrmann Jan 19, 2024
6b8f4b6
refactor put_jobs
jtherrmann Jan 20, 2024
1ad2d8d
improve error message in decrement_credits
jtherrmann Jan 20, 2024
20fffb2
add TODO
jtherrmann Jan 20, 2024
34d0eda
add TODO
jtherrmann Jan 20, 2024
af4b76f
update test_put_jobs
jtherrmann Jan 20, 2024
dfb84e9
split test_put_jobs_no_quota into two new tests
jtherrmann Jan 20, 2024
eb03667
further improve error message in decrement_credits
jtherrmann Jan 20, 2024
e9a2a42
do not attempt to decrement credits if remaining_credits is null
jtherrmann Jan 20, 2024
9d2bb6b
move TODO
jtherrmann Jan 20, 2024
84ff328
update test_put_jobs_priority_override
jtherrmann Jan 20, 2024
f350492
update test_put_jobs_priority
jtherrmann Jan 20, 2024
f06b3a8
rename variable, add some TODOs
jtherrmann Jan 20, 2024
1e681ed
fix test_put_jobs_priority_overflow
jtherrmann Jan 22, 2024
d05769b
fix test_submit_exceeds_quota
jtherrmann Jan 22, 2024
33e5c7a
fix flake8 findings for imports
asjohnston-asf Jan 22, 2024
496944f
Update apps/api/src/hyp3_api/handlers.py
asjohnston-asf Jan 22, 2024
aa58548
Update apps/api/src/hyp3_api/handlers.py
asjohnston-asf Jan 22, 2024
a206464
Update tests/test_api/test_submit_job.py
jtherrmann Jan 22, 2024
088378f
Merge pull request #2024 from ASFHyP3/credit-futzing
jtherrmann Jan 22, 2024
de77a71
give api lambda dynamodb:PutItem permissions on user table
asjohnston-asf Jan 22, 2024
7a8d0c4
Merge pull request #2029 from ASFHyP3/credit-iam
jtherrmann Jan 22, 2024
a23f330
add dynamodb:UpdateItem permissions on user table for API lambda
asjohnston-asf Jan 22, 2024
ef32090
Merge pull request #2030 from ASFHyP3/credit-iam
jtherrmann Jan 22, 2024
6a332d5
leverage batch writer in dynamo.jobs.put_jobs
asjohnston-asf Jan 22, 2024
c08a7cb
add tests for desired priority behavior
jtherrmann Jan 22, 2024
3d2d7db
priority is remaining credits
jtherrmann Jan 22, 2024
d0997cb
handle credits as floats
jtherrmann Jan 23, 2024
5bd8815
refactor put_jobs to track running cost
jtherrmann Jan 23, 2024
e8b3ceb
total_cost as float
jtherrmann Jan 23, 2024
eed2fe2
Merge pull request #2031 from ASFHyP3/batch-writer
jtherrmann Jan 23, 2024
80ef533
Merge branch 'credits-sandbox' into extra-credits-highest-priority
jtherrmann Jan 23, 2024
f402a3d
delete TODO
jtherrmann Jan 23, 2024
44143db
Merge branch 'extra-credits-highest-priority' of github.com:ASFHyP3/h…
jtherrmann Jan 23, 2024
7b4215c
Merge pull request #2032 from ASFHyP3/extra-credits-highest-priority
jtherrmann Jan 23, 2024
5350364
draft of monthly credits reset function
jtherrmann Jan 24, 2024
96a8ba1
revise dynamo.user functions
jtherrmann Jan 24, 2024
ef50337
update usages of dynamo.user
jtherrmann Jan 24, 2024
ef03dd4
delete old dynamo.user tests
jtherrmann Jan 25, 2024
524100d
rename env var
jtherrmann Jan 25, 2024
6dbd5d2
rename field
jtherrmann Jan 25, 2024
db1683c
fix bug in dynamo.user, start updating tests
jtherrmann Jan 25, 2024
f85d415
test user exists and no reset
jtherrmann Jan 25, 2024
59a2414
test create user for get_or_create_user
jtherrmann Jan 25, 2024
9a3b60b
remove TODO
jtherrmann Jan 25, 2024
29d41ec
test create user
jtherrmann Jan 25, 2024
bc0d195
test create user failed
jtherrmann Jan 25, 2024
b7f7a3a
remove TODO
jtherrmann Jan 25, 2024
0d1454e
add a TODO
jtherrmann Jan 25, 2024
3a21dfd
add a TODO
jtherrmann Jan 25, 2024
1165cc7
start rewriting tests for get_or_create_user, mocking private functions
jtherrmann Jan 25, 2024
b0bd383
finish rewriting tests for get_or_create_user
jtherrmann Jan 25, 2024
e702193
test reset credits
jtherrmann Jan 25, 2024
4614ee5
test reset credits with env var false
jtherrmann Jan 25, 2024
64dcd06
test reset credits same month
jtherrmann Jan 25, 2024
87e239c
test reset with infinite credits
jtherrmann Jan 25, 2024
2ac1712
test reset credits failed check for month
jtherrmann Jan 25, 2024
ce65e98
test reset credits failed with infinite credits
jtherrmann Jan 25, 2024
853d276
remove TODO
jtherrmann Jan 25, 2024
337f5aa
remove old test decrement credits
jtherrmann Jan 26, 2024
d026795
add updated test decrement credits
jtherrmann Jan 26, 2024
0c6966c
test decrement credits with cost <= 0
jtherrmann Jan 26, 2024
a6f3a36
test decrement credits cost too high
jtherrmann Jan 26, 2024
c1dbdfe
test decrement credits with infinite credits
jtherrmann Jan 26, 2024
fd18029
add some asserts
jtherrmann Jan 26, 2024
fbceb73
test decrement credits user does not exist
jtherrmann Jan 26, 2024
2ce6b31
update TODOs
jtherrmann Jan 26, 2024
1f6dadb
add more asserts for users table state
jtherrmann Jan 26, 2024
24731d8
remove TODO
jtherrmann Jan 26, 2024
0de662d
assert with scan instead of get_item
jtherrmann Jan 26, 2024
c0ec2ce
rename some tests
jtherrmann Jan 26, 2024
ff1bae7
Pass RESET_CREDITS_MONTHLY env var through
jtherrmann Jan 26, 2024
9773ad8
fix pre-existing tests
jtherrmann Jan 26, 2024
a184f0a
add noqa
jtherrmann Jan 26, 2024
834e2cc
Update apps/main-cf.yml.j2
jtherrmann Jan 26, 2024
5036ab3
allow overriding credits per month for individual user
jtherrmann Jan 27, 2024
8a617d3
Merge branch 'monthly-credits-reset' of github.com:ASFHyP3/hyp3 into …
jtherrmann Jan 27, 2024
cc32c67
reset credits for all enterprise deployments
jtherrmann Jan 27, 2024
f10161a
Merge pull request #2036 from ASFHyP3/monthly-credits-reset
jtherrmann Jan 27, 2024
17b8a03
mark RESET_CREDITS_MONTHLY required in deploy action
jtherrmann Jan 27, 2024
e1fc638
Merge pull request #2042 from ASFHyP3/required-param
jtherrmann Jan 27, 2024
898baa0
use true/false for reset_credits_monthly
jtherrmann Jan 27, 2024
5c3b30f
Merge pull request #2043 from ASFHyP3/required-param
jtherrmann Jan 27, 2024
ad5bbe0
decrement credits before creating job records
jtherrmann Jan 29, 2024
eb8b3e8
refactor mock side effect
jtherrmann Jan 29, 2024
9eaeac8
Merge pull request #2045 from ASFHyP3/decrement-credits-before-jobs
jtherrmann Jan 29, 2024
c521bb1
prefix private dynamo.jobs functions with underscore
jtherrmann Jan 29, 2024
7cbdd94
improve test_put_jobs_insufficient_credits
jtherrmann Jan 29, 2024
e68dca8
set DEFAULT_CREDITS_PER_USER in test_put_jobs
jtherrmann Jan 29, 2024
0e05901
test put_jobs when user exists
jtherrmann Jan 29, 2024
dcdd565
change username in test
jtherrmann Jan 29, 2024
9170884
remove TODO
jtherrmann Jan 29, 2024
dbc886a
rename test
jtherrmann Jan 29, 2024
b6b3935
remove unused import
jtherrmann Jan 29, 2024
a451a1b
Merge pull request #2052 from ASFHyP3/credits-test-coverage
jtherrmann Jan 30, 2024
2688368
Merge branch 'develop' into credits-sandbox
jtherrmann Jan 30, 2024
91b8315
Bump cryptography from 42.0.1 to 42.0.2
dependabot[bot] Jan 30, 2024
23c8f5f
changelog
jtherrmann Jan 30, 2024
2c9aa86
changelog
jtherrmann Jan 30, 2024
2546e20
Merge pull request #2048 from ASFHyP3/credits-sandbox
jtherrmann Jan 30, 2024
4f5f479
Bump boto3 from 1.34.29 to 1.34.31
dependabot[bot] Jan 31, 2024
215019e
fix cloudwatch metric used to monitor for api 5xx errors
asjohnston-asf Feb 1, 2024
f36aed6
add DAR tags to S3 buckets in earthdata cloud deployments
asjohnston-asf Feb 1, 2024
bccdb49
move changelog entry under 6.0.0
asjohnston-asf Feb 1, 2024
3e6b136
Merge pull request #2054 from ASFHyP3/dependabot/pip/cryptography-42.0.2
asjohnston-asf Feb 1, 2024
a7f6660
Merge pull request #2057 from ASFHyP3/dependabot/pip/boto3-1.34.31
asjohnston-asf Feb 1, 2024
a323350
Merge pull request #2058 from ASFHyP3/500-alarm
asjohnston-asf Feb 1, 2024
f8b62ba
Bump boto3 from 1.34.31 to 1.34.32
dependabot[bot] Feb 1, 2024
9d55a0e
Merge pull request #2060 from ASFHyP3/dependabot/pip/boto3-1.34.32
asjohnston-asf Feb 1, 2024
81993c5
Merge branch 'develop' into dar-tags
asjohnston-asf Feb 1, 2024
d19faa4
move changelog entry under 6.0.0 release
asjohnston-asf Feb 1, 2024
27aaa47
Merge pull request #2059 from ASFHyP3/dar-tags
asjohnston-asf Feb 1, 2024
78db59a
quota yes/no string to keep yaml parser from changing them to true/false
asjohnston-asf Feb 1, 2024
de6d29e
Merge pull request #2061 from ASFHyP3/dar-tags
asjohnston-asf Feb 1, 2024
2fceb9a
remove non-functional cloudwatch alarm for api 5xx errors
asjohnston-asf Feb 1, 2024
d3761b0
Merge pull request #2062 from ASFHyP3/remove-api-alarm
asjohnston-asf Feb 2, 2024
ec153c2
minor documentation tweaks prior to v6.0.0 release
asjohnston-asf Feb 2, 2024
6852c75
Merge pull request #2063 from ASFHyP3/v6-tweaks
jtherrmann Feb 2, 2024
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
12 changes: 8 additions & 4 deletions .github/actions/deploy-hyp3/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ inputs:
CLOUDFORMATION_ROLE_ARN:
description: "The CloudFormation role to use for this deployment"
required: true
MONTHLY_JOB_QUOTA_PER_USER:
description: "The default number of jobs any user with an Earthdata Login can run per month"
DEFAULT_CREDITS_PER_USER:
description: "The default number of credits given to a new user"
required: true
RESET_CREDITS_MONTHLY:
description: "Whether to reset each user's remaining credits each month"
required: true
JOB_FILES:
description: "Space seperated list of job spec YAMLs to include"
description: "Space separated list of job spec YAMLs to include"
required: true
DEFAULT_MAX_VCPUS:
description: "Default maximum size for the AWS Batch compute environment"
Expand Down Expand Up @@ -119,7 +122,8 @@ runs:
$CERTIFICATE_ARN \
$ORIGIN_ACCESS_IDENTITY_ID \
$DISTRIBUTION_URL \
MonthlyJobQuotaPerUser='${{ inputs.MONTHLY_JOB_QUOTA_PER_USER }}' \
DefaultCreditsPerUser='${{ inputs.DEFAULT_CREDITS_PER_USER }}' \
ResetCreditsMonthly='${{ inputs.RESET_CREDITS_MONTHLY }}' \
DefaultMaxvCpus='${{ inputs.DEFAULT_MAX_VCPUS }}' \
ExpandedMaxvCpus='${{ inputs.EXPANDED_MAX_VCPUS }}' \
MonthlyBudget='${{ inputs.MONTHLY_BUDGET }}' \
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/deploy-credits-sandbox.yml
asjohnston-asf marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Deploy Credits Sandbox Stack to AWS

on:
push:
branches:
- credits-sandbox

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
deploy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- environment: hyp3-credits-sandbox
domain: hyp3-credits-sandbox.asf.alaska.edu
template_bucket: cf-templates-1hz9ldhhl4ahu-us-west-2
image_tag: test
product_lifetime_in_days: 14
default_credits_per_user: 0
reset_credits_monthly: true
deploy_ref: refs/heads/credits-sandbox
job_files: job_spec/AUTORIFT.yml job_spec/INSAR_GAMMA.yml job_spec/RTC_GAMMA.yml job_spec/INSAR_ISCE_BURST.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
default_max_vcpus: 640
expanded_max_vcpus: 640
required_surplus: 0
security_environment: ASF
ami_id: /aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id
distribution_url: ''

environment:
name: ${{ matrix.environment }}
url: https://${{ matrix.domain }}

steps:
- uses: actions/[email protected]

- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.V2_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.V2_AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ secrets.V2_AWS_SESSION_TOKEN }}
aws-region: ${{ secrets.AWS_REGION }}

- uses: actions/setup-python@v5
with:
python-version: 3.9

- uses: ./.github/actions/deploy-hyp3
with:
TEMPLATE_BUCKET: ${{ matrix.template_bucket }}
STACK_NAME: ${{ matrix.environment }}
DOMAIN_NAME: ${{ matrix.domain }}
API_NAME: ${{ matrix.environment }}
CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
IMAGE_TAG: ${{ matrix.image_tag }}
PRODUCT_LIFETIME: ${{ matrix.product_lifetime_in_days }}
VPC_ID: ${{ secrets.VPC_ID }}
SUBNET_IDS: ${{ secrets.SUBNET_IDS }}
SECRET_ARN: ${{ secrets.SECRET_ARN }}
CLOUDFORMATION_ROLE_ARN: ${{ secrets.CLOUDFORMATION_ROLE_ARN }}
DEFAULT_CREDITS_PER_USER: ${{ matrix.default_credits_per_user }}
RESET_CREDITS_MONTHLY: ${{ matrix.reset_credits_monthly }}
JOB_FILES: ${{ matrix.job_files }}
DEFAULT_MAX_VCPUS: ${{ matrix.default_max_vcpus }}
EXPANDED_MAX_VCPUS: ${{ matrix.expanded_max_vcpus }}
MONTHLY_BUDGET: ${{ secrets.MONTHLY_BUDGET }}
REQUIRED_SURPLUS: ${{ matrix.required_surplus }}
ORIGIN_ACCESS_IDENTITY_ID: ${{ secrets.ORIGIN_ACCESS_IDENTITY_ID }}
SECURITY_ENVIRONMENT: ${{ matrix.security_environment }}
AMI_ID: ${{ matrix.ami_id }}
INSTANCE_TYPES: ${{ matrix.instance_types }}
DISTRIBUTION_URL: ${{ matrix.distribution_url }}
AUTH_PUBLIC_KEY: ${{ secrets.AUTH_PUBLIC_KEY }}
9 changes: 6 additions & 3 deletions .github/workflows/deploy-daac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
template_bucket: cf-templates-118mtzosmrltk-us-west-2
image_tag: latest
product_lifetime_in_days: 14
quota: 1000
default_credits_per_user: 1000
reset_credits_monthly: true
deploy_ref: refs/heads/main
job_files: job_spec/AUTORIFT.yml job_spec/INSAR_GAMMA.yml job_spec/RTC_GAMMA.yml job_spec/INSAR_ISCE_BURST.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
Expand All @@ -38,7 +39,8 @@ jobs:
template_bucket: cf-templates-118ylv0o6jp2n-us-west-2
image_tag: test
product_lifetime_in_days: 14
quota: 1000
default_credits_per_user: 1000
reset_credits_monthly: true
deploy_ref: refs/heads/develop
job_files: >-
job_spec/AUTORIFT.yml
Expand Down Expand Up @@ -86,7 +88,8 @@ jobs:
SUBNET_IDS: ${{ secrets.SUBNET_IDS }}
SECRET_ARN: ${{ secrets.SECRET_ARN }}
CLOUDFORMATION_ROLE_ARN: ${{ secrets.CLOUDFORMATION_ROLE_ARN }}
MONTHLY_JOB_QUOTA_PER_USER: ${{ matrix.quota }}
DEFAULT_CREDITS_PER_USER: ${{ matrix.default_credits_per_user }}
RESET_CREDITS_MONTHLY: ${{ matrix.reset_credits_monthly }}
JOB_FILES: ${{ matrix.job_files }}
DEFAULT_MAX_VCPUS: ${{ matrix.default_max_vcpus }}
EXPANDED_MAX_VCPUS: ${{ matrix.expanded_max_vcpus }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/deploy-enterprise-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
template_bucket: cf-templates-1iw894v4yzqya-us-west-2
image_tag: test
product_lifetime_in_days: 14
quota: 0
default_credits_per_user: 0
reset_credits_monthly: false
deploy_ref: refs/heads/develop
job_files: >-
job_spec/AUTORIFT_ITS_LIVE.yml
Expand Down Expand Up @@ -69,7 +70,8 @@ jobs:
SUBNET_IDS: ${{ secrets.SUBNET_IDS }}
SECRET_ARN: ${{ secrets.SECRET_ARN }}
CLOUDFORMATION_ROLE_ARN: ${{ secrets.CLOUDFORMATION_ROLE_ARN }}
MONTHLY_JOB_QUOTA_PER_USER: ${{ matrix.quota }}
DEFAULT_CREDITS_PER_USER: ${{ matrix.default_credits_per_user }}
RESET_CREDITS_MONTHLY: ${{ matrix.reset_credits_monthly }}
JOB_FILES: ${{ matrix.job_files }}
DEFAULT_MAX_VCPUS: ${{ matrix.default_max_vcpus }}
EXPANDED_MAX_VCPUS: ${{ matrix.expanded_max_vcpus }}
Expand Down
39 changes: 26 additions & 13 deletions .github/workflows/deploy-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
template_bucket: cf-templates-3o5lnspmwmzg-us-west-2
image_tag: latest
product_lifetime_in_days: 45
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: >-
job_spec/AUTORIFT_ITS_LIVE.yml
job_spec/AUTORIFT_ITS_LIVE_TEST.yml
Expand All @@ -37,7 +38,8 @@ jobs:
template_bucket: cf-templates-v4pvone059de-us-west-2
image_tag: latest
product_lifetime_in_days: 180
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/INSAR_ISCE.yml job_spec/INSAR_ISCE_TEST.yml
instance_types: c6id.xlarge,c6id.2xlarge,c6id.4xlarge,c6id.8xlarge
default_max_vcpus: 10000
Expand All @@ -52,7 +54,8 @@ jobs:
template_bucket: cf-templates-1or0efwqffkgd-us-west-2
image_tag: latest
product_lifetime_in_days: 60
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/INSAR_ISCE.yml job_spec/INSAR_ISCE_TEST.yml
instance_types: c6id.xlarge,c6id.2xlarge,c6id.4xlarge,c6id.8xlarge
default_max_vcpus: 0
Expand All @@ -67,7 +70,8 @@ jobs:
template_bucket: cf-templates-gdeyr9hh8rzs-us-west-2
image_tag: latest
product_lifetime_in_days: 14
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/INSAR_ISCE.yml job_spec/INSAR_ISCE_TEST.yml
instance_types: c6id.xlarge,c6id.2xlarge,c6id.4xlarge,c6id.8xlarge
default_max_vcpus: 1600
Expand All @@ -82,7 +86,8 @@ jobs:
template_bucket: cf-templates-1x4a21iq1cba7-us-west-2
image_tag: latest
product_lifetime_in_days: 365000
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/INSAR_GAMMA.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
default_max_vcpus: 640
Expand All @@ -97,7 +102,8 @@ jobs:
template_bucket: cf-templates-1217di08q7vwl-us-west-2
image_tag: latest
product_lifetime_in_days: 14
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/RTC_GAMMA.yml job_spec/WATER_MAP.yml job_spec/WATER_MAP_EQ.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
default_max_vcpus: 640
Expand All @@ -112,7 +118,8 @@ jobs:
template_bucket: cf-templates-15gmiot9prm67-us-west-2
image_tag: latest
product_lifetime_in_days: 90
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/RTC_GAMMA.yml job_spec/WATER_MAP.yml job_spec/WATER_MAP_EQ.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
default_max_vcpus: 1600
Expand All @@ -127,7 +134,8 @@ jobs:
template_bucket: cf-templates-xlga17noink6-us-west-2
image_tag: latest
product_lifetime_in_days: 30
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/INSAR_GAMMA.yml job_spec/INSAR_ISCE_BURST.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
default_max_vcpus: 640
Expand All @@ -142,7 +150,8 @@ jobs:
template_bucket: cf-templates-j4kd746vpsuv-us-east-1
image_tag: latest
product_lifetime_in_days: 14
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/INSAR_GAMMA.yml job_spec/RTC_GAMMA.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
default_max_vcpus: 640
Expand All @@ -157,7 +166,8 @@ jobs:
template_bucket: cf-templates-ez0805f6vy20-us-west-2
image_tag: latest
product_lifetime_in_days: 14
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/INSAR_GAMMA.yml job_spec/RTC_GAMMA.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
default_max_vcpus: 640
Expand All @@ -172,7 +182,8 @@ jobs:
template_bucket: cf-templates-1qx2mwia5g4kh-us-west-2
image_tag: latest
product_lifetime_in_days: 30
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/INSAR_GAMMA.yml job_spec/RTC_GAMMA.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
default_max_vcpus: 640
Expand All @@ -189,7 +200,8 @@ jobs:
# TODO product lifetime could be much shorter since they all get transferred to a separate
# S3 bucket, but maybe we want to allow for a backlog of products-to-be-transferred?
product_lifetime_in_days: 14
quota: 0
default_credits_per_user: 0
reset_credits_monthly: true
job_files: job_spec/WATER_MAP.yml
instance_types: r6id.xlarge,r6id.2xlarge,r6id.4xlarge,r6id.8xlarge,r6idn.xlarge,r6idn.2xlarge,r6idn.4xlarge,r6idn.8xlarge
default_max_vcpus: 640
Expand Down Expand Up @@ -230,7 +242,8 @@ jobs:
SUBNET_IDS: ${{ secrets.SUBNET_IDS }}
SECRET_ARN: ${{ secrets.SECRET_ARN }}
CLOUDFORMATION_ROLE_ARN: ${{ secrets.CLOUDFORMATION_ROLE_ARN }}
MONTHLY_JOB_QUOTA_PER_USER: ${{ matrix.quota }}
DEFAULT_CREDITS_PER_USER: ${{ matrix.default_credits_per_user }}
RESET_CREDITS_MONTHLY: ${{ matrix.reset_credits_monthly }}
JOB_FILES: ${{ matrix.job_files }}
DEFAULT_MAX_VCPUS: ${{ matrix.default_max_vcpus }}
EXPANDED_MAX_VCPUS: ${{ matrix.expanded_max_vcpus }}
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ 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).

## [6.0.0]

HyP3's monthly quota system has been replaced by a credits system. Previously, HyP3 provided each user with a certain number of jobs per month. Now, each job costs a particular number of credits, and users spend credits when they submit jobs. This release assigns every job a cost of 1 credit, but future releases will assign a different credit cost to each job type. Additionally, the main production deployment (`https://hyp3-api.asf.alaska.edu`) resets each user's balance to 1,000 credits each month, effectively granting each user 1,000 jobs per month. Therefore, users should not notice any difference when ordering jobs via ASF's On Demand service at <https://search.asf.alaska.edu>.

### Added
- The `job` object returned by the `/jobs` API endpoint now includes a `credit_cost` attribute, which represents the job's cost in credits.
- A `DAR` tag is now included in Earthdata Cloud deployments for each S3 bucket to communicate which contain objects
that required to be encrypted at rest.

### Changed
- The `quota` attribute of the `user` object returned by the `/user` API endpoint has been replaced by a `remaining_credits` attribute, which represents the user's remaining credits.

### Removed
- The non-functional CloudWatch alarm for API 5xx errors has been removed from the `monitoring` module. See [#2044](https://github.com/ASFHyP3/hyp3/issues/2044).

## [5.0.4]
### Added
- `INSAR_ISCE_BURST` jobs are now available in the azdwr-hyp3 deployment.
Expand Down
15 changes: 9 additions & 6 deletions apps/api/api-cf.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ Parameters:
AuthAlgorithm:
Type: String

MonthlyJobQuotaPerUser:
DefaultCreditsPerUser:
Type: Number

ResetCreditsMonthly:
Type: String

SystemAvailable:
Type: String

Expand All @@ -41,9 +44,6 @@ Outputs:
Url:
Value: {{ '!Sub "https://${RestApi}.execute-api.${AWS::Region}.amazonaws.com/${Stage}/ui"' if security_environment == 'EDC' else '!Sub "https://${CustomDomainName}/ui"' }}

ApiId:
Value: !Ref RestApi

Resources:

RestApi:
Expand Down Expand Up @@ -161,13 +161,15 @@ Resources:
Resource: !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/*"
- Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:BatchWriteItem
- dynamodb:Query
- dynamodb:GetItem
Resource: !Sub "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${JobsTable}*"
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
Resource: !Sub "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${UsersTable}*"

Lambda:
Expand All @@ -179,7 +181,8 @@ Resources:
USERS_TABLE_NAME: !Ref UsersTable
AUTH_PUBLIC_KEY: !Ref AuthPublicKey
AUTH_ALGORITHM: !Ref AuthAlgorithm
MONTHLY_JOB_QUOTA_PER_USER: !Ref MonthlyJobQuotaPerUser
DEFAULT_CREDITS_PER_USER: !Ref DefaultCreditsPerUser
RESET_CREDITS_MONTHLY: !Ref ResetCreditsMonthly
SYSTEM_AVAILABLE: !Ref SystemAvailable
Code: src/
Handler: hyp3_api.lambda_handler.handler
Expand Down
Loading
Loading