💬 The allas-conf
command opens an Allas connection that is valid for eight hours.
allas-conf
can be executed again to extend the validity of the connection.allas-conf
again with the -k
option:allas-conf -k
-k
indicates that the password will be stored in an environment variable $OS_PASSWORD
.
allas-conf
with the -k
option and the Allas project name.☝🏻 Note that if you mistype your password when using the -k
option, you must use the command unset OS_PASSWORD
before you can try again.
allas-conf -k <project> # replace <project> with your CSC project, e.g. project_2001234
☝🏻 When $OS_PASSWORD
is set, the a-commands
(a-put
, a-get
, a-list
, a-delete
) automatically refresh the Allas connection when the commands are executed in a batch job.
a-list <project number>_$USER # replace <project number> with your CSC project number, e.g. 2001234, to match the bucket you created earlier
nano allas_<myjobname>.sh # replace <myjobname> with a custom name for your job
a-commands
#!/bin/bash
#SBATCH --job-name=my_allas_job # Name of the job visible in the queue.
#SBATCH --account=<project> # Choose the billing project. Has to be defined!
#SBATCH --time=00:05:00 # Maximum duration of the job. Max: depends of the partition.
#SBATCH --mem-per-cpu=1G # How much RAM is reserved for one processor.
#SBATCH --partition=test # Job queues: test, interactive, small, large, longrun, hugemem, $
#SBATCH --output=allas_output_%j.txt # Name of the output-file.
#SBATCH --error=allas_errors_%j.txt # Name of the error-file.
bucketname=<project number>_$USER # Replace with your bucket name, e.g. 2001234_username
filename=<filename> # Replace with your file name
a-get $bucketname/$filename # Bucket name / file name
wc -l $filename > $filename.num_rows # file name
a-put -b $bucketname $filename.num_rows
<project number>_$USER
to match your bucket name and <filename>
to the name of the file you have in Allas. Remember to also define your billing project (--account
).rclone
💭 If you use rclone
or swift
instead of the a-commands
, you need to add source allas_conf
commands to your script.
#!/bin/bash
#SBATCH --job-name=my_allas_job # Name of the job visible in the queue.
#SBATCH --account=<project> # Choose the billing project. Has to be defined!
#SBATCH --time=00:05:00 # Maximum duration of the job. Max: depends of the partition.
#SBATCH --mem-per-cpu=1G # How much RAM is reserved for one processor.
#SBATCH --partition=test # Job queues: test, interactive, small, large, longrun, hugemem, $
#SBATCH --output=allas_output_%j.txt # Name of the output-file.
#SBATCH --error=allas_errors_%j.txt # Name of the error-file.
bucketname=<project number>_$USER # Replace with your bucket name, e.g. 2001234_username
filename=<filename> # Replace with your file name
# Make sure the connection to Allas is open
source /appl/opt/csc-cli-utils/allas-cli-utils/allas_conf -f -k $OS_PROJECT_NAME
rclone copy allas:$bucketname/$filename ./
wc -l $filename > $filename.num_rows
# Make sure the connection to Allas is open
source /appl/opt/csc-cli-utils/allas-cli-utils/allas_conf -f -k $OS_PROJECT_NAME
rclone copy $filename.num_rows allas:$bucketname
<project number>_$USER
to match your bucket name and <filename>
to the name of the file you have in Allas. Remember to also define your billing project (--account
).sbatch allas_<myjobname>.sh
squeue -u $USER
a-list <project number>_$USER # replace <project number> with your CSC project number, e.g. 2001234, to match your bucket