Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geosphere-deploy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cspp_geo
geosphere
geosphere-deploy
Commits
ba2933b1
Verified
Commit
ba2933b1
authored
1 year ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Add initial proof of concept DB sync script
parent
61337ced
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-2
2 additions, 2 deletions
README.md
helpers/sync_s3_geotiffs_to_db.sh
+26
-0
26 additions, 0 deletions
helpers/sync_s3_geotiffs_to_db.sh
helpers/sync_s3_geotiffs_to_db_job_tmpl.yaml
+85
-0
85 additions, 0 deletions
helpers/sync_s3_geotiffs_to_db_job_tmpl.yaml
with
113 additions
and
2 deletions
README.md
+
2
−
2
View file @
ba2933b1
...
@@ -110,9 +110,9 @@ and the locations of the other repositories related to GeoSphere.
...
@@ -110,9 +110,9 @@ and the locations of the other repositories related to GeoSphere.
production website running on the SSEC gamma cluster.
production website running on the SSEC gamma cluster.
*
**gamma-geosphere-test/**
: Helm chart and ArgoCD application for the
*
**gamma-geosphere-test/**
: Helm chart and ArgoCD application for the
dev site running on the SSEC gamma cluster.
dev site running on the SSEC gamma cluster.
*
**helpers/**
: Scripts and YAML files to help with CI jobs. So
e
m of these are
*
**helpers/**
: Scripts and YAML files to help with CI jobs. Som
e
of these are
used by sub-component repositories to reduce the amount of duplicated code
used by sub-component repositories to reduce the amount of duplicated code
between GeoSphere CI environments.
between GeoSphere CI environments.
Other helpful scripts are also stored here.
*
**sidecars/**
: Docker image configurations for various "sidecar" containers that
*
**sidecars/**
: Docker image configurations for various "sidecar" containers that
don't fit in one subcomponent's project.
don't fit in one subcomponent's project.
*
**.gitlab-ci.yml**
: Continuous Integration (CI) configuration. This file
*
**.gitlab-ci.yml**
: Continuous Integration (CI) configuration. This file
...
...
This diff is collapsed.
Click to expand it.
helpers/sync_s3_geotiffs_to_db.sh
0 → 100755
+
26
−
0
View file @
ba2933b1
#!/usr/bin/env bash
# Purpose: Scan through every geotiff in an S3 bucket and add an associated
# to the GeoSphere database.
debug
()
{
>
&2
echo
"DEBUG:
$@
"
}
error
()
{
>
&2
echo
"ERROR:
$@
"
exit
1
}
if
[[
$#
-ne
3
]]
;
then
error
"Usage: ./sync_s3_geotiffs_to_db.sh <namespace> <objectBucketClaim name> <postgres hostname>"
fi
export
NAMESPACE
=
$1
export
OBC_NAME
=
$2
export
POSTGRES_HOST
=
$3
export
POSTGRES_SECRET
=
"geosphere-postgresql"
SCRIPT_DIR
=
"
$(
cd
-P
"
$(
dirname
"
$(
readlink
-f
"
${
BASH_SOURCE
[0]
}
"
)
"
)
"
&&
pwd
)
"
tty
=
$(
tty
)
envsubst <
"
${
SCRIPT_DIR
}
/sync_s3_geotiffs_to_db_job_tmpl.yaml"
|
\
tee
${
tty
}
| kubectl apply
-n
${
NAMESPACE
}
-f
-
\ No newline at end of file
This diff is collapsed.
Click to expand it.
helpers/sync_s3_geotiffs_to_db_job_tmpl.yaml
0 → 100644
+
85
−
0
View file @
ba2933b1
apiVersion
:
batch/v1
kind
:
Job
metadata
:
name
:
geosphere-db-sync
namespace
:
"
${NAMESPACE}"
labels
:
{}
annotations
:
{}
spec
:
ttlSecondsAfterFinished
:
300
template
:
spec
:
securityContext
:
runAsUser
:
1000
restartPolicy
:
Never
volumes
:
-
name
:
postgres-secret
secret
:
secretName
:
"
${POSTGRES_SECRET}"
containers
:
-
name
:
refresh-db
image
:
"
gitlab.ssec.wisc.edu:5555/cspp_geo/geosphere/geosphere-tile-gen/geosphere-tile-gen:0b8e9299"
imagePullPolicy
:
IfNotPresent
args
:
-
/work/refresh_missing_db_records.py
-
"
geotiffs/{satellite_id}/{instrument_id}/{sector_id}"
-
--postgres-host
-
"
${POSTGRES_HOST}"
-
--postgres-password-file
-
"
/secrets/postgres-password"
resources
:
limits
:
cpu
:
"
2.0"
memory
:
"
4Gi"
requests
:
cpu
:
"
1.0"
memory
:
"
2Gi"
securityContext
:
readOnlyRootFilesystem
:
true
volumeMounts
:
-
name
:
postgres-secret
mountPath
:
"
/secrets"
readOnly
:
true
env
:
-
name
:
G2G_PRODUCTS
value
:
"
"
-
name
:
PRODUCT_SECTORS
value
:
"
"
-
name
:
PRODUCT_SATELLITES
value
:
"
"
-
name
:
"
AWS_S3_ENDPOINT"
valueFrom
:
configMapKeyRef
:
name
:
"
${OBC_NAME}"
key
:
"
BUCKET_HOST"
-
name
:
"
AWS_S3_ENDPOINT_PORT"
valueFrom
:
configMapKeyRef
:
name
:
"
${OBC_NAME}"
key
:
"
BUCKET_PORT"
-
name
:
SRC_BUCKET
valueFrom
:
configMapKeyRef
:
name
:
"
${OBC_NAME}"
key
:
"
BUCKET_NAME"
-
name
:
AWS_ACCESS_KEY_ID
valueFrom
:
secretKeyRef
:
name
:
"
${OBC_NAME}"
key
:
"
AWS_ACCESS_KEY_ID"
-
name
:
AWS_SECRET_ACCESS_KEY
valueFrom
:
secretKeyRef
:
name
:
"
${OBC_NAME}"
key
:
"
AWS_SECRET_ACCESS_KEY"
-
name
:
RABBITMQ_OUT_HOST
value
:
"
"
-
name
:
RABBITMQ_OUT_EXCHANGE_NAME
value
:
"
satellite"
-
name
:
RABBITMQ_OUT_USERNAME
value
:
"
user"
# - name: RABBITMQ_OUT_PASSWORD
# valueFrom:
# secretKeyRef:
# name: "geosphere-rabbitmq"
# key: rabbitmq-password
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment