Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install aiida in conda environment, fix problem with .bashrc #3745

Merged
merged 5 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .docker/opt/configure-aiida.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,26 @@
set -x

# Environment.
reentry scan
export SHELL=/bin/bash

# Activate conda.
__conda_setup="$('/opt/conda/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/conda/etc/profile.d/conda.sh" ]; then
. "/opt/conda/etc/profile.d/conda.sh"
else
export PATH="/opt/conda/bin:$PATH"
fi
fi
unset __conda_setup

# Very important to run after conda activation, otherwise AiiDA won't work.
reentry scan

# Setup AiiDA autocompletion.
grep _VERDI_COMPLETE .bash_profile &> /dev/null || echo 'eval "$(_VERDI_COMPLETE=source verdi)"' >> /home/$SYSTEM_USER/.bashrc
grep _VERDI_COMPLETE /home/$SYSTEM_USER/.bashrc &> /dev/null || echo 'eval "$(_VERDI_COMPLETE=source verdi)"' >> /home/$SYSTEM_USER/.bashrc

# Check if user requested to set up AiiDA profile (and if it exists already)
if [[ $SETUP_DEFAULT_PROFILE == true ]] && ! verdi profile show $PROFILE_NAME &> /dev/null; then
Expand Down Expand Up @@ -57,4 +72,4 @@ verdi profile show || echo "The default profile is not set."
verdi database migrate --force || echo "Database migration failed."

# Daemon will start only if the database exists and is migrated to the latest version.
verdi daemon start || echo "AiiDA daemon is not running."
verdi daemon start || echo "AiiDA daemon is not running."
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ jobs:
sudo apt-get update
sudo apt-get install docker-ce

- name: Build the aiida-core image and run it
run: |
- name: Build the aiida-core image
run:
docker build -t aiida-core .
docker run -d aiida-core

- name: Check that default AiiDA profile was set up
- name: Run aiida-core image and test the default aiida profile and localhost computer.
run: |
export DOCKERID=`docker ps -qf 'ancestor=aiida-core'`
export DOCKERID=`docker run -d aiida-core`
docker exec --tty $DOCKERID wait-for-services
docker logs $DOCKERID
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'verdi profile show default'
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'verdi computer show localhost'
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ COPY .docker/my_init.d/configure-aiida.sh /etc/my_init.d/40_configure-aiida.sh

# Use phusion baseimage docker init system.
CMD ["/sbin/my_init"]

#EOF