-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.molgen.mpg.de/EditionOpenAcce…
- Loading branch information
Showing
9 changed files
with
88 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/input/ | ||
/output/ | ||
/runtime/ | ||
/dependencies/ | ||
examples | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
#!/bin/bash | ||
|
||
|
||
echo 'export PATH="$EOA_SCRIPTS_DIR:$PATH"' >> ~/.bashrc | ||
|
||
ln -s $INPUT_DIR input | ||
ln -s $OUTPUT_DIR output | ||
echo 'export PATH="$EOA_SCRIPTS_DIR:$PATH"' > ./.bashrc | ||
|
||
# wait, keep container running: | ||
bash -c 'while :; do :; done & kill -STOP $! && wait $!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,73 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from utils.settings import BASE_DIR, load_config | ||
from utils.settings import env_file, BASE_DIR, load_config, create_docker_env_file | ||
|
||
from pathlib import Path | ||
import shutil | ||
import os | ||
|
||
def rm_dirs( config, rm_deps): | ||
path = Path( BASE_DIR, config['DEPENDENCIES_DIR'] ) | ||
def rm_dir( | ||
path | ||
): | ||
print( "removing dir '{}'".format( path ) ) | ||
shutil.rmtree( | ||
path, | ||
ignore_errors=True | ||
) | ||
|
||
def rm_docker_env_file( config ): | ||
path = Path( | ||
BASE_DIR / ".env" | ||
) | ||
print( "removing '{}'".format( path ) ) | ||
path.unlink() | ||
def rm_file( | ||
path | ||
): | ||
if path.is_file(): | ||
print( "removing file '{}'".format( path ) ) | ||
path.unlink() | ||
|
||
if __name__ == '__main__': | ||
|
||
from argparse import ArgumentParser | ||
|
||
if not env_file.exists(): | ||
create_docker_env_file() | ||
config = load_config() | ||
|
||
parser = ArgumentParser( | ||
description="clean up the repository" | ||
) | ||
parser.add_argument( | ||
"--rm-deps", | ||
action = "store_true" | ||
"-d", "--deps", | ||
action = "store_true", | ||
help = "remove dependencies", | ||
) | ||
parser.add_argument( | ||
"-r", "--runtime", | ||
action = "store_true", | ||
help = "remove '{rt_dir}'".format( rt_dir = BASE_DIR / config['RUNTIME_DIR'] ), | ||
) | ||
parser.add_argument( | ||
"--env-file", | ||
action = "store_true" | ||
"-e", "--env", | ||
action = "store_true", | ||
help = "remove existing .env file", | ||
) | ||
parser.add_argument( | ||
"--all", | ||
action = "store_true" | ||
action = "store_true", | ||
help = "purge in every way", | ||
) | ||
args = parser.parse_args() | ||
|
||
from stop import stop | ||
|
||
stop( config ) | ||
|
||
rm_dirs( | ||
config, | ||
rm_deps = args.rm_deps or args.all | ||
) | ||
if args.env_file or args.all: | ||
rm_docker_env_file( config ) | ||
if args.deps or args.all: | ||
rm_dir( | ||
path = BASE_DIR / config['DEPENDENCIES_DIR'] | ||
) | ||
if args.runtime or args.all: | ||
rm_dir( | ||
path = BASE_DIR / config['RUNTIME_DIR'] | ||
) | ||
if args.env or args.all: | ||
rm_file( | ||
env_file | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters