Skip to content

Commit 675b094

Browse files
authored
Merge pull request #215 from spacetelescope/release/v0.4.48
Release/v0.4.48
2 parents f3962d2 + 71672d9 commit 675b094

11 files changed

Lines changed: 45 additions & 20 deletions

File tree

calcloud/batch.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
from . import common
1515

16-
1716
JOB_STATUSES = tuple("SUBMITTED|PENDING|RUNNABLE|STARTING|RUNNING|SUCCEEDED|FAILED".split("|"))
1817

1918
KILL_STATUSES = tuple("SUBMITTED|PENDING|RUNNABLE|STARTING|RUNNING".split("|"))

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
- update caldp version and changelog.md
2+
- add point-of-contact email tag
3+
- dependency updates
4+
- only retrieve latest 24 images
5+
- add EPH (ephemeral) to image names

lambda/JobPredict/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ RUN mv /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-bundle.crt.org && ln -s /e
2020
RUN yum update -y java-1.8.0-openjdk
2121

2222
#RUN python3.7 -m pip install --upgrade pip && python3.7 -m pip install -r requirements.txt && python3.7 -m pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow_cpu-2.6.2-cp37-cp37m-manylinux2010_x86_64.whl
23-
RUN python3.11 -m pip install --upgrade pip && python3.11 -m pip install -r requirements.txt && python3.11 -m pip install tensorflow-cpu==2.12.1
23+
# Install numpy, h5py, scipy, and ml_dtypes first from wheels so later deps don't trigger source builds (no gcc in image).
24+
RUN python3.11 -m pip install --upgrade pip && python3.11 -m pip install "numpy>=1.23,<2" "h5py==3.10.0" "scipy==1.11.4" "ml_dtypes==0.5.1"
25+
RUN python3.11 -m pip install -r requirements.txt
2426
ADD models ./models/
2527
RUN chmod -R ugo+r ./models/
2628
RUN find ./models/ -type d -exec chmod og+x {} +

lambda/JobPredict/requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
numpy>=1.23,<2
2+
h5py==3.10.0
3+
scipy==1.11.4
4+
ml_dtypes==0.5.1
5+
tensorflow-cpu==2.12.1
16
scikit-learn==1.3.0
27
boto3==1.28.56
38
protobuf==4.24.3

terraform/batch.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11

22

33
provider "aws" {
4-
region = var.region
4+
region = var.region
5+
default_tags {
6+
tags = {
7+
stsci-poc-email = var.stsci_poc_email
8+
}
9+
}
510
}
611

712
terraform {

terraform/deploy.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ echo $aws_tfstate
1414

1515
# get AMI id(s)
1616
cd $CALCLOUD_BUILD_DIR/ami_rotation
17-
ami_json=$(echo $(awsudo $ADMIN_ARN aws ec2 describe-images --region us-east-1 --executable-users self))
17+
# Limit responses to the most recent 24 images to prevent "Argument list too long"
18+
query='{Images: reverse(sort_by(Images, &CreationDate))[:24]}'
19+
ami_json="$(
20+
awsudo "$ADMIN_ARN" \
21+
"aws ec2 describe-images --region us-east-1 --executable-users self --query '$query' --output json"
22+
)"
1823
ci_ami=`python3 parse_image_json.py "${ami_json}" STSCI-AMAZON-LINUX2023`
19-
ecs_ami=`python3 parse_image_json.py "${ami_json}" STSCI-ECS-AL2023`
24+
ecs_ami=`python3 parse_image_json.py "${ami_json}" STSCI-EPH-ECS-AL2023`
2025

2126
if [[ "$ci_ami" =~ ^ami-[a-z0-9]+$ ]]; then
2227
echo $ci_ami
@@ -83,8 +88,8 @@ awsudo $ADMIN_ARN aws s3api put-object --bucket $bucket_url --key crds_env_vars/
8388
awsudo $ADMIN_ARN aws s3api put-object --bucket $bucket_url --key crds_env_vars/${crds_context}
8489

8590
# tag images as in-use by this environment
86-
cd $CALCLOUD_BUILD_DIR/terraform
87-
# this script doesn't replace "old-tag", it just takes that image, and adds this tag to it.
91+
cd $CALCLOUD_BUILD_DIR/terraform
92+
# this script doesn't replace "old-tag", it just takes that image, and adds this tag to it.
8893
# And in fact, if another image exists with this tag, it's removed from that one; so this is image promotion all-in-one
8994
echo ${aws_env}
9095
./deploy_image_promote.sh --old-tag $CALDP_ECR_TAG batch-${aws_env}

terraform/deploy_ami_rotate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CSYS_VER=`echo $CSYS_VER | tr -d '",'`
2020
# i.e. CALCLOUD_BUILD_DIR="$HOME/deployer/calcloud"
2121
# these can be set as environment variables before running to avoid changing the script directly
2222
# (and avoid accidentally committing a custom path to the repo...)
23-
CALCLOUD_BUILD_DIR=${CALCLOUD_BUILD_DIR:-""}
23+
CALCLOUD_BUILD_DIR=${CALCLOUD_BUILD_DIR:-""}
2424
CALDP_BUILD_DIR=${CALDP_BUILD_DIR:-""}
2525

2626
# variables that will be changed less-frequently
@@ -50,7 +50,7 @@ fi
5050

5151
# check for Batch jobs and exit if any exist that are running or should be soon
5252
cd ${CALCLOUD_BUILD_DIR}/scripts
53-
./check_batch_jobs.py
53+
./check_batch_jobs.py
5454
batch_jobs=$?
5555
if [[ $batch_jobs -ne 0 ]]; then
5656
echo "there are running or submitted batch jobs; cannot rotate ami"
@@ -77,7 +77,7 @@ echo $aws_tfstate
7777
cd $CALCLOUD_BUILD_DIR/ami_rotation
7878
ami_json=$(echo $(awsudo $ADMIN_ARN aws ec2 describe-images --region us-east-1 --executable-users self))
7979
ci_ami=`python3 parse_image_json.py "${ami_json}" STSCI-AMAZON-LINUX2023`
80-
ecs_ami=`python3 parse_image_json.py "${ami_json}" STSCI-ECS-AL2023`
80+
ecs_ami=`python3 parse_image_json.py "${ami_json}" STSCI-EPH-ECS-AL2023`
8181

8282
if [[ "$ci_ami" =~ ^ami-[a-z0-9]+$ ]]; then
8383
echo $ci_ami

terraform/deploy_ami_rotate_codebuild_script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CSYS_VER=`echo $CSYS_VER | tr -d '",'`
2121
# i.e. CALCLOUD_BUILD_DIR="$HOME/deployer/calcloud"
2222
# these can be set as environment variables before running to avoid changing the script directly
2323
# (and avoid accidentally committing a custom path to the repo...)
24-
CALCLOUD_BUILD_DIR=${CALCLOUD_BUILD_DIR:-""}
24+
CALCLOUD_BUILD_DIR=${CALCLOUD_BUILD_DIR:-""}
2525
CALDP_BUILD_DIR=${CALDP_BUILD_DIR:-""}
2626

2727
# variables that will be changed less-frequently
@@ -78,7 +78,7 @@ echo $aws_tfstate
7878
cd $CALCLOUD_BUILD_DIR/ami_rotation
7979
ami_json=$(echo $(aws ec2 describe-images --region us-east-1 --executable-users self))
8080
ci_ami=`python3 parse_image_json.py "${ami_json}" STSCI-AMAZON-LINUX2023`
81-
ecs_ami=`python3 parse_image_json.py "${ami_json}" STSCI-ECS-AL2023`
81+
ecs_ami=`python3 parse_image_json.py "${ami_json}" STSCI-EPH-ECS-AL2023`
8282

8383
if [[ "$ci_ami" =~ ^ami-[a-z0-9]+$ ]]; then
8484
echo $ci_ami

terraform/deploy_vars.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/bash -xu
2-
export CALCLOUD_VER="v0.4.47"
3-
export CALDP_VER="v0.2.29"
4-
export CAL_BASE_IMAGE="stsci/hst-pipeline:2025.3.1.7-alignmentmatches-py311"
2+
export CALCLOUD_VER="v0.4.48"
3+
export CALDP_VER="v0.2.30"
4+
export CAL_BASE_IMAGE="stsci/hst-pipeline:2026.2.1.7-arcticdrizzle-py312"
55

66
export BASE_IMAGE_TAG=`cut -d ":" -f2- <<< ${CAL_BASE_IMAGE} `
77

terraform/variables.tf

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ variable region {
2020
default = "us-east-1"
2121
}
2222

23+
variable "stsci_poc_email" {
24+
description = "Value for mandatory AWS tag stsci-poc-email for KMS, RDS, or S3 resources in STScI SDLC accounts."
25+
type = string
26+
default = "team-violet@stsci.edu"
27+
}
28+
2329
variable awsdpver {
2430
description = "HST keyword for caldp repo tag version"
2531
type = string
@@ -117,10 +123,10 @@ variable crds_context {
117123
description = "the crds context to be the default for the environment"
118124
type = map(string)
119125
default = {
120-
"-sb" = "hst_1241.pmap"
121-
"-dev" = "hst_1241.pmap"
122-
"-test" = "hst_1247.pmap"
123-
"-ops" = "hst_1247.pmap"
126+
"-sb" = "hst_1298.pmap"
127+
"-dev" = "hst_1298.pmap"
128+
"-test" = "hst_1323.pmap"
129+
"-ops" = "hst_1323.pmap"
124130
}
125131
}
126132

0 commit comments

Comments
 (0)