diff --git a/shared/workspaces/alembic/versions/f9d03744dd49_upgrade_pimcache_python310.py b/shared/workspaces/alembic/versions/f9d03744dd49_upgrade_pimcache_python310.py new file mode 100644 index 0000000000000000000000000000000000000000..825604b5ff997f6cfdbd9dafcf982fcb1321de1d --- /dev/null +++ b/shared/workspaces/alembic/versions/f9d03744dd49_upgrade_pimcache_python310.py @@ -0,0 +1,75 @@ +"""upgrade pimcache python310 + +Revision ID: f9d03744dd49 +Revises: d3bf0fcd237c +Create Date: 2024-04-02 16:21:05.867044 + +""" +from pathlib import Path + +from alembic import op + + +# revision identifiers, used by Alembic. +revision = "f9d03744dd49" +down_revision = "82f7b57c8ad7" +branch_labels = None +depends_on = None + + +coarse_old_content = (Path.cwd() / "versions" / "templates" / "vlass_coarse" / "fetch_2.8.1.txt").read_text() +coarse_new_content = (Path.cwd() / "versions" / "templates" / "vlass_coarse" / "fetch_2.8.3.txt").read_text() + +ql_old_content = (Path.cwd() / "versions" / "templates" / "vlass_quicklook" / "fetch_2.8.1.txt").read_text() +ql_new_content = (Path.cwd() / "versions" / "templates" / "vlass_quicklook" / "fetch_2.8.3.txt").read_text() + +seci_old_content = (Path.cwd() / "versions" / "templates" / "vlass_seci" / "fetch_2.8.1.txt").read_text() +seci_new_content = (Path.cwd() / "versions" / "templates" / "vlass_seci" / "fetch_2.8.3.txt").read_text() + + +def upgrade(): + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{coarse_new_content}' + WHERE filename='vlass_coarse_fetch.sh' AND workflow_name='vlass_coarse' + """ + ) + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{ql_new_content}' + WHERE filename='vlass_ql_fetch.sh' AND workflow_name='vlass_quicklook' + """ + ) + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{seci_new_content}' + WHERE filename='vlass_seci_fetch.sh' AND workflow_name='vlass_seci' + """ + ) + + +def downgrade(): + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{coarse_old_content}' + WHERE filename='vlass_coarse_fetch.sh' AND workflow_name='vlass_coarse' + """ + ) + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{ql_old_content}' + WHERE filename='vlass_ql_fetch.sh' AND workflow_name='vlass_quicklook' + """ + ) + op.execute( + f""" + UPDATE workflow_templates + SET content=E'{seci_old_content}' + WHERE filename='vlass_seci_fetch.sh' AND workflow_name='vlass_seci' + """ + ) diff --git a/shared/workspaces/alembic/versions/templates/pims_split/split_sh_2.8.3.txt b/shared/workspaces/alembic/versions/templates/pims_split/split_sh_2.8.3.txt index 160c6dd7dc205b9b061810c49f568dcaa4c249aa..1dc72f063bcdb9c19910810efa46890062f6806f 100644 --- a/shared/workspaces/alembic/versions/templates/pims_split/split_sh_2.8.3.txt +++ b/shared/workspaces/alembic/versions/templates/pims_split/split_sh_2.8.3.txt @@ -1,5 +1,7 @@ #!/bin/sh export HOME=$TMPDIR +export PATH=$PATH:/home/ssa/bin + TILE=$(echo $1 | cut -d "/" -f 1) PHCENTER=$(echo $1 | cut -d "/" -f 2) STAGE=$1 diff --git a/shared/workspaces/alembic/versions/templates/vlass_coarse/fetch_2.8.3.txt b/shared/workspaces/alembic/versions/templates/vlass_coarse/fetch_2.8.3.txt new file mode 100644 index 0000000000000000000000000000000000000000..9469291e22bb5be0523f4f63380b171307158db3 --- /dev/null +++ b/shared/workspaces/alembic/versions/templates/vlass_coarse/fetch_2.8.3.txt @@ -0,0 +1,13 @@ +#!/bin/sh +set -o errexit + +export HOME=$TMPDIR +export PATH=$PATH:/home/ssa/bin + +./update_stage FETCH +chmod 770 . +cd rawdata/ +../pimscache ln -c $1 -p $2 . +../productfetcher --product-locator $4 --product-locator $5 +cd ../ +./update_stage FETCH --complete diff --git a/shared/workspaces/alembic/versions/templates/vlass_image_caching/caching_sh_2.8.3.txt b/shared/workspaces/alembic/versions/templates/vlass_image_caching/caching_sh_2.8.3.txt index 318ede4ecf2b888480d6e969f88e417452ade0d1..1f4011af0f64704bd71f2de0e60934ac6e762f21 100644 --- a/shared/workspaces/alembic/versions/templates/vlass_image_caching/caching_sh_2.8.3.txt +++ b/shared/workspaces/alembic/versions/templates/vlass_image_caching/caching_sh_2.8.3.txt @@ -1,5 +1,6 @@ #!/bin/sh export CAPO_PROFILE=vlass.{{vlass_env}} +export PATH=$PATH:/home/ssa/bin if [ -n "$5" ]; then ./pimscache rm -c $1 -p $2 diff --git a/shared/workspaces/alembic/versions/templates/vlass_quicklook/fetch_2.8.3.txt b/shared/workspaces/alembic/versions/templates/vlass_quicklook/fetch_2.8.3.txt new file mode 100644 index 0000000000000000000000000000000000000000..ea8f92b71824bd4f2af8f0ddbdf881c1737d5b9e --- /dev/null +++ b/shared/workspaces/alembic/versions/templates/vlass_quicklook/fetch_2.8.3.txt @@ -0,0 +1,9 @@ +#!/bin/sh +set -o errexit + +export HOME=$TMPDIR +export PATH=$PATH:/home/ssa/bin + +./update_stage FETCH +./pimscache ln -c $1 -p $2 $3 +./update_stage FETCH --complete diff --git a/shared/workspaces/alembic/versions/templates/vlass_seci/fetch_2.8.3.txt b/shared/workspaces/alembic/versions/templates/vlass_seci/fetch_2.8.3.txt new file mode 100644 index 0000000000000000000000000000000000000000..ea8f92b71824bd4f2af8f0ddbdf881c1737d5b9e --- /dev/null +++ b/shared/workspaces/alembic/versions/templates/vlass_seci/fetch_2.8.3.txt @@ -0,0 +1,9 @@ +#!/bin/sh +set -o errexit + +export HOME=$TMPDIR +export PATH=$PATH:/home/ssa/bin + +./update_stage FETCH +./pimscache ln -c $1 -p $2 $3 +./update_stage FETCH --complete