-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create tool for easily uploading files to qfs on cluster
- Loading branch information
1 parent
3a74238
commit 21e5846
Showing
1 changed file
with
20 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Usage: | ||
# ./upload_bz2_files_to_qfa.sh /local/path/to/source_dir /path/oth/qfs/destination_dir | ||
# | ||
# Will create docker container using the qfs-master image and connectiong to | ||
# the spark_cluster_network swarm network. | ||
# | ||
|
||
source_dir=${1%/} | ||
|
||
echo "Uploading files from $source_dir locally to $2 on QFS." | ||
docker run -it \ | ||
--network spark_cluster_network \ | ||
--mount type=bind,src=$source_dir,dst=/data \ | ||
--env DESTINATION_DIR=$2 \ | ||
qfs-master:latest \ | ||
/bin/bash -c \ | ||
'qfs -fs qfs://qfs-master:20000 -mkdir $DESTINATION_DIR; for filename in /data/*.bz2; do echo "uploading - ${filename} to $DESTINATION_DIR"; ( cptoqfs -s qfs-master -p 20000 -d "${filename}" -k $DESTINATION_DIR -r 2 ); done; echo "Finished uploading files."' |