Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Merge requests
!499
Fixing pulling images out of subdirectories for REAL
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fixing pulling images out of subdirectories for REAL
WS-673_fix_single_img_crash_issue
into
main
Overview
2
Commits
10
Pipelines
3
Changes
1
1 unresolved thread
Hide all comments
Merged
Charlotte Hausman
requested to merge
WS-673_fix_single_img_crash_issue
into
main
3 years ago
Overview
2
Commits
10
Pipelines
3
Changes
1
1 unresolved thread
Hide all comments
Expand
0
0
Merge request reports
Compare
main
version 2
112a9d23
3 years ago
version 1
2a572e82
3 years ago
main (base)
and
latest version
latest version
02353128
10 commits,
3 years ago
version 2
112a9d23
9 commits,
3 years ago
version 1
2a572e82
7 commits,
3 years ago
1 file
+
88
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
schema/versions/0953fe9fb794_fix_subdir_removal.py
0 → 100644
+
88
−
0
Options
"""
fix subdir removal
Revision ID: 0953fe9fb794
Revises: 42723a9dd85c
Create Date: 2021-09-13 16:38:13.209103
"""
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
"
0953fe9fb794
"
down_revision
=
"
42723a9dd85c
"
branch_labels
=
None
depends_on
=
None
script_content
=
"""
#!/bin/sh
set -o errexit
export HOME=$TMPDIR
fetch_foundation(){
../productfetcher{{product_locator}}
echo
"
Moving images out of subdirectories....
"
for dir in *.fits; do mv $dir $dir.1; done;
find . -mindepth 1 -type f -print -exec mv {} . \;
find . -mindepth 1 -type d -empty -delete
echo
"
Done. Ready for Carta!
"
}
{{#need_data}}
./framework.sh -r .
chmod 770 .
cd rawdata/
fetch_foundation {{^single_image}}&{{/single_image}}
.{{/need_data}}./carta_envoy {{#need_data}}--parallel{{/need_data}} {{#single_image}}--single -i {{imageName}}{{/single_image}} -d $1 -n $2 -wf $3 -r $4
{{#need_data}}wait{{/need_data}}
"""
old_content
=
"""
#!/bin/sh
set -o errexit
export HOME=$TMPDIR
{{#need_data}}
./framework.sh -r .
chmod 770 .
cd rawdata/
../productfetcher{{product_locator}} {{^single_image}}&{{/single_image}}
image_subdirs=$(ls)
for i in $image_subdirs; do
if [[ -d
"
./$i
"
]]; then
mv
"
./$i
"
/* .
rm -rf
"
./$i
"
fi
done
.{{/need_data}}./carta_envoy {{#need_data}}--parallel{{/need_data}} {{#single_image}}--single -i {{imageName}}{{/single_image}} -d $1 -n $2 -wf $3 -r $4
{{#need_data}}wait{{/need_data}}
"""
def
upgrade
():
op
.
execute
(
f
"""
UPDATE workflow_templates
SET content=E
'
{
script_content
}
'
where filename=
'
carta.sh
'
"""
)
def
downgrade
():
op
.
execute
(
f
"""
UPDATE workflow_templates
SET content=E
'
{
old_content
}
'
where filename=
'
carta.sh
'
"""
)
Loading