#! /bin/sh -e # genenetwork-machines --- Guix configuration for genenetwork machines # Copyright © 2025 Munyoki Kilyungi # # This file is part of genenetwork-machines. # # genenetwork-machines is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # genenetwork-machines is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with genenetwork-machines. If not, see # . # Build and install genenetwork production container on tux02. system_directories=("$HOME"/genenetwork/var/log "$HOME"/genenetwork/var/genenetwork "$HOME"/genenetwork/etc/genenetwork/conf "$HOME"/genenetwork/etc/genenetwork "$HOME"/genenetwork/var/lib/redis "$HOME"/genenetwork/var/lib/virtuoso "$HOME"/genenetwork/var/lib/xapian "$HOME"/genenetwork/var/lib/genenetwork-sqlite "$HOME"/genenetwork/var/lib/genenetwork-gnqa /tmp/local-container) for dir in "${system_directories[@]}"; do if [[ ! -d $dir ]]; then mkdir -p $dir fi done gn_projects=(genenetwork2 genenetwork3) for project in "${gn_projects[@]}"; do dir="${HOME}/genenetwork/${project}" if [[ ! -d $dir ]]; then git clone "git@github.com:genenetwork/${project}" $dir fi done if [[ ! -d "${HOME}/genenetwork/gn-auth" ]]; then git clone "https://git.genenetwork.org/gn-auth" "${HOME}/genenetwork/gn-auth" fi if [[ ! -d "${HOME}/genenetwork/gn-docs" ]]; then git clone --bare "https://git.genenetwork.org/gn-docs" "${HOME}/genenetwork/gn-docs" fi container_script=$(guix system container \ --network \ --load-path=. \ --verbosity=3 \ --share="$HOME"/genenetwork/var/log=/var/log \ --share="$HOME"/genenetwork/var/genenetwork=/var/genenetwork \ --share="$HOME"/genenetwork/etc/genenetwork/conf=/etc/genenetwork/conf \ --share="$HOME"/genenetwork/etc/genenetwork=/etc/genenetwork \ --share="$HOME"/genenetwork/var/lib/redis=/var/lib/redis \ --share="$HOME"/genenetwork/var/lib/virtuoso/=/var/lib/virtuoso \ --share="$HOME"/genenetwork/genenetwork2=/genenetwork2 \ --share="$HOME"/genenetwork/genenetwork3=/genenetwork3 \ --share="$HOME"/genenetwork/gn-auth=/gn-auth \ --share="$HOME"/genenetwork/var/lib/xapian=/var/lib/xapian \ --share="$HOME"/genenetwork/var/lib/genenetwork-sqlite=/var/lib/genenetwork-sqlite \ --share="$HOME"/genenetwork/var/lib/genenetwork-gnqa=/var/lib/genenetwork-gnqa \ --share=/tmp/local-container=/tmp \ --share="$HOME"/genenetwork/gn-docs=/var/lib/gn-docs \ --share=/run/mysqld=/run/mysqld \ genenetwork-local-container.scm) echo $container_script sudo ln --force --symbolic $container_script /usr/local/bin/genenetwork-local-container sudo ln --force --symbolic /usr/local/bin/genenetwork-local-container /var/guix/gcroots