Skip to content
Snippets Groups Projects
Select Git revision
  • e1469e00f8dbc09facecb4dba26400c83c50308a
  • master default protected
  • development
  • v10.4.1
  • lcm_nudge
  • m_lcm
  • flexpart_lcm
  • fix_GFS
  • optimise
  • fix_GFS_23
  • feature_gfs_fix
  • wetdepo_bugfix
  • feature/newWetDepo
  • tests
  • christine
  • split_mods
  • openmp
  • anne
  • release-10.4.1
  • dev
  • 10.4.1_pesei
  • v11_beta
  • v10.4
  • v10.4_beta
  • v10.4_alpha
  • v9.2.0.3
  • v9.2
  • FPv9.3.2e
  • FPv9.3.2d
  • FPv9.3.2c
  • FPv9.3.2b
  • v9.2.0.2_Yosemite
  • ICR-1008
  • v10.2beta
  • FPv9.3.2a
  • fp9.3.1-20170412-nc4-coded
  • fp9.3.1-20170408-nc4
  • devlan-20161106
  • FPv9.3.1f
  • FPv9.3.1e
  • FPv9.3.1d
41 results

clustering.f90

Blame
  • Forked from Flexpart / Flexpart
    Source project has a limited visibility.
    install.sh 4.04 KiB
    #!/bin/bash
    
    # preset
    VERSION="1.4.5"
    MIN_CPU=8
    MIN_RAM=8
    MIN_MAP_COUNT=262144
    SKIP_CHECKS=${SKIP_CHECKS:-0}
    
    # checks
    if [[ $SKIP_CHECKS -eq 0 ]]; then
      echo "[✨] Startup check ..."
      docker info > /dev/null
      if [[ $? -ne 0 ]]; then
        echo "Docker is not installed (or accessible in bash) on your system:"
        echo ""
        echo "  - install docker from https://docs.docker.com/desktop/install/linux-install/"
        echo "  - make sure the docker executable is in \$PATH"
        exit 2
      else
        echo "$(docker --version) OK"
      fi
      CPU=$(cat /proc/cpuinfo | grep processor | wc -l)
      if [[ $CPU -lt $MIN_CPU ]]; then
        echo "You do not have enough vCPU resources available:"
        echo ""
        echo "  - we found ${CPU} vCPU cores instead of necessary ${MIN_CPU}"
        echo "  - if you believe this is a mistake, skip startup checks with the SKIP_CHECKS=1 flag"
        exit 3
      else
        echo "vCPU ${CPU} OK"
      fi
      RAM=$(free -g -t | awk 'NR==2 {print $7}')
      if [[ $RAM -lt $MIN_RAM ]]; then
        echo "You do not have enough RAM free resources:"
        echo ""
        echo "  - we found ${RAM}GB RAM (free) instead of necessary ${RAM}GB"
        echo "  - if you believe this is a mistake, skip startup checks with the SKIP_CHECKS=1 flag"
        exit 4
      else
        echo "RAM ${RAM}GB OK"
      fi
      MAX_MAP_COUNT=$(cat /etc/sysctl.conf | grep -oP "vm.max_map_count=.*" | grep -oP "[0-9]+")
      if [[ $MAX_MAP_COUNT -lt $MIN_MAP_COUNT ]]; then
        echo "You do not have enough max. map counts:"
        echo ""
        echo "  - we found max. ${MAX_MAP_COUNT} map count instead of necessary ${MIN_MAP_COUNT}"
        echo "  - update your /etc/sysctl.conf file and add the line 'vm.max_map_count=${MIN_MAP_COUNT}' at the end and apply it with 'sysctl -p'"
        echo "  - if you believe this is a mistake, skip startup checks with the SKIP_CHECKS=1 flag"
        exit 4
      else
        echo "MAP COUNT ${MAX_MAP_COUNT} OK"
      fi
    else
      echo "[✨] Skipping checks ..."
    fi
    
    # environment
    echo "[🚀] Gathering environment ..."
    mkdir -p ./dist
    curl -sSL -o ./docker-compose.yml "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/.docker/docker-compose.yml"
    curl -sSL -o ./dist/1_setup-schema.sql "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/dbrepo-metadata-db/setup-schema.sql"
    curl -sSL -o ./dist/2_setup-data.sql "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/dbrepo-metadata-db/setup-data.sql"
    curl -sSL -o ./dist/rabbitmq.conf "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/dbrepo-broker-service/rabbitmq.conf"
    curl -sSL -o ./dist/enabled_plugins "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/dbrepo-broker-service/enabled_plugins"
    curl -sSL -o ./dist/definitions.json "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/dbrepo-broker-service/definitions.json"
    curl -sSL -o ./dist/dbrepo.conf "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/dbrepo-gateway-service/dbrepo.conf"
    curl -sSL -o ./dist/opensearch_dashboards.yml "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/dbrepo-search-db/opensearch_dashboards.yml"
    curl -sSL -o ./dist/dbrepo.config.json "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/dbrepo-ui/dbrepo.config.json"
    curl -sSL -o ./dist/s3_config.json "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/raw/release-${VERSION}/dbrepo-storage-service/s3_config.json"
    
    echo "[📦] Pulling images for version ${VERSION} ..."
    docker compose pull
    
    echo "[✨] Starting DBRepo ..."
    docker compose up -d
    
    if [ $? -eq 0 ]; then
      echo "[🎉] Successfully started!"
      echo ""
      echo "You can now inspect the logs with:"
      echo ""
      echo "  docker compose logs -f"
      echo ""
      echo "Read about next steps online: https://www.ifs.tuwien.ac.at/infrastructures/dbrepo/${VERSION}/installation/#next-steps"
    fi