Skip to content

Commit

Permalink
add some pulsar functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cat-bro committed Jan 16, 2024
1 parent 3467a6e commit e48fcf3
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion roles/common/tasks/bashrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,30 @@
}
{% endif %}
{% if ansible_hostname in groups['pulsar_head_nodes'] %}
# pulsar
jwd() { # print path of job working directory for job id
echo {{ pulsar_staging_dir }}/${1}
}
jwd-size() {
du -sh $(jwd $1)
}
go-jwd() { # go to job working directory for job id
cd $(jwd $1)
}
tail-stderr() {
stderr_filename=$(jwd $1)/metadata/tool_stderr
if [ ! -f $stderr_filename ]; then
echo "No stderr file for job $1";
else
tail $stderr_filename;
fi
}
{% endif %}
- name: Template helper scripts
template:
src: "bashrc/{{ item }}.j2"
Expand All @@ -73,13 +97,15 @@
source {{ common_bashrc_vars_file }}
source {{ common_bashrc_functions_file }}
# local to user
{% if is_galaxy_head_node %}
# galaxy (per user)
{% if item == 'ubuntu' %}
export PGUSER='galaxy'
{% elif 'tiaas_admin' in item.roles|d([]) %}
export PGUSER='tiaasadmin'
{% else %}
export PGUSER='reader'
{% endif %}
{% endif %}
with_items: "{{ machine_users + [{'name': 'ubuntu'}] }}"

0 comments on commit e48fcf3

Please sign in to comment.