Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ColonelPanics/c49e76b3f284c039c72b2582d3a9254e to your computer and use it in GitHub Desktop.

Select an option

Save ColonelPanics/c49e76b3f284c039c72b2582d3a9254e to your computer and use it in GitHub Desktop.

Revisions

  1. ColonelPanics revised this gist Apr 10, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions web-suite-from-source-on-solo.sh
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,7 @@ get_app_config() {
    }

    dnf remove -y alces-flight-landing-page-branding
    dnf -y install rsync

    # Landing Page
    git clone https://github.com/openflighthpc/flight-landing-page /tmp/landing-page
  2. ColonelPanics revised this gist Apr 10, 2024. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion tweaks.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,6 @@
    GIST_URL="https://gist.github.com/ColonelPanicks/c49e76b3f284c039c72b2582d3a9254e/raw"

    curl -L SCRIPT |/bin/bash
    SCRIPTS="flight-profile-types-from-source-on-solo.sh web-suite-from-source-on-solo.sh"
    for script in $SCRIPTS ; do
    curl -L $GIST_URL/$script |/bin/bash
    done
  3. ColonelPanics revised this gist Apr 10, 2024. 2 changed files with 14 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions flight-profile-types-from-source-on-solo.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/bin/bash

    FLIGHT_ROOT="/opt/flight"
    export PATH="$PATH:$FLIGHT_ROOT/bin"
    VERSION=${VERSION:-type/openflight-web-access}

    mv /opt/flight/usr/lib/profile/types /opt/flight/usr/lib/profile/types_orig
    git clone https://github.com/openflighthpc/flight-profile-types /opt/flight/usr/lib/profile/types
    cd /opt/flight/usr/lib/profile/types
    git checkout $VERSION

    flight profile prepare openflight-web-access
    2 changes: 2 additions & 0 deletions tweaks.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@

    curl -L SCRIPT |/bin/bash
  4. ColonelPanics created this gist Apr 10, 2024.
    95 changes: 95 additions & 0 deletions web-suite-from-source-on-solo.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,95 @@
    #!/bin/bash

    FLIGHT_ROOT="/opt/flight"
    export PATH="$PATH:$FLIGHT_ROOT/bin"

    clone_and_install() {
    repo=$1
    branch=$2
    location=$3

    mv $location ${location}_orig
    git clone $repo $location
    cd $location
    git checkout $branch
    bash bin/yarn-link-webapp-components.sh
    yarn install
    yarn run build
    }

    get_app_config() {
    wget -O $FLIGHT_ROOT/opt/www/landing-page/default/content/apps/$2 $1
    }

    dnf remove -y alces-flight-landing-page-branding

    # Landing Page
    git clone https://github.com/openflighthpc/flight-landing-page /tmp/landing-page
    cd /tmp/landing-page
    git checkout dev/front-end
    mv $FLIGHT_ROOT/opt/www/landing-page/default $FLIGHT_ROOT/opt/www/landing-page/default_orig
    mv $FLIGHT_ROOT/opt/www/landing-page/lib $FLIGHT_ROOT/opt/www/landing-page/lib_orig
    mv $FLIGHT_ROOT/opt/www/landing-page/Rules $FLIGHT_ROOT/opt/www/landing-page/Rules_orig
    rsync -auv landing-page/types/default/ $FLIGHT_ROOT/opt/www/landing-page/default/
    rsync -auv landing-page/lib/ $FLIGHT_ROOT/opt/www/landing-page/lib/
    rsync -auv landing-page/Rules $FLIGHT_ROOT/opt/www/landing-page/

    # Maybe get rid of "overridden" dir so alces branding page doesn't take precedence
    # Maybe download the config packs

    mkdir -p $FLIGHT_ROOT/opt/www/landing-page/default/content/apps/
    get_app_config https://raw.githubusercontent.com/openflighthpc/openflight-omnibus-builder/fix/web-suite-redesign/builders/flight-console-webapp/opt/flight/opt/www/landing-page/default/content/apps/console.md console.md
    get_app_config https://raw.githubusercontent.com/openflighthpc/openflight-omnibus-builder/fix/web-suite-redesign/builders/flight-desktop-webapp/opt/flight/opt/www/landing-page/default/content/apps/desktop.md desktop.md
    get_app_config https://raw.githubusercontent.com/openflighthpc/openflight-omnibus-builder/fix/web-suite-redesign/builders/flight-file-manager-webapp/opt/flight/opt/www/landing-page/default/content/apps/file-manager.md file-manager.md
    get_app_config https://raw.githubusercontent.com/openflighthpc/openflight-omnibus-builder/fix/web-suite-redesign/builders/flight-job-script-webapp/opt/flight/opt/www/landing-page/default/content/apps/job-script.md job-script.md

    # WebApp Components
    git clone https://github.com/openflighthpc/flight-webapp-components /tmp/webapp-components
    cd /tmp/webapp-components
    git checkout dev/front-end
    export REACT_APP_LOGIN_API_BASE_URL="/login/api/v0"
    yarn install
    yarn run build
    cd builder
    yarn add react-router-dom
    yarn install
    yarn run build
    cd ..
    bash bin/setup-yarn-link-webapp-components.sh
    mkdir -p $FLIGHT_ROOT/opt/www/landing-page/default/content/{js,styles}
    cp -vf builder/build/static/js/main.js $FLIGHT_ROOT/opt/www/landing-page/default/content/js/login.js
    cp -vf builder/build/static/css/main.css $FLIGHT_ROOT/opt/www/landing-page/default/content/styles/login.css

    # Console WebApp
    clone_and_install https://github.com/openflighthpc/flight-console-webapp dev/front-end $FLIGHT_ROOT/opt/console-webapp
    cp $FLIGHT_ROOT/opt/console-webapp_orig/build/config.json $FLIGHT_ROOT/opt/console-webapp/build/

    # Desktop WebApp
    clone_and_install https://github.com/openflighthpc/flight-desktop-webapp dev/front-end $FLIGHT_ROOT/opt/desktop-webapp
    cp $FLIGHT_ROOT/opt/desktop-webapp_orig/build/config.json $FLIGHT_ROOT/opt/desktop-webapp/build/

    # File Manager
    git clone https://github.com/openflighthpc/flight-file-manager /tmp/file-manager
    cd /tmp/file-manager
    git checkout dev/front-end-continue
    cd client
    bash bin/yarn-link-webapp-components.sh
    yarn install
    yarn run build
    mv $FLIGHT_ROOT/opt/file-manager-webapp/ $FLIGHT_ROOT/opt/file-manager-webapp_orig
    rsync -auv . $FLIGHT_ROOT/opt/file-manager-webapp/
    cp $FLIGHT_ROOT/opt/file-manager-webapp_orig/build/config.json $FLIGHT_ROOT/opt/file-manager-webapp/build/

    # Flight Job
    git clone https://github.com/openflighthpc/flight-job-script-service /tmp/job-script-service
    cd /tmp/job-script-service
    git checkout dev/front-end
    cd client
    bash bin/yarn-link-webapp-components.sh
    yarn install
    yarn run build
    mv $FLIGHT_ROOT/opt/job-script-webapp/ $FLIGHT_ROOT/opt/job-script-webapp_orig
    rsync -auv . $FLIGHT_ROOT/opt/job-script-webapp/
    cp $FLIGHT_ROOT/opt/job-script-webapp_orig/build/config.json $FLIGHT_ROOT/opt/job-script-webapp/build/

    echo "If web suite is already running then landing-page compile and restart the services"