Skip to content

Commit

Permalink
fix(dashboard): gh #651 Fixed turbovnc version and template for local…
Browse files Browse the repository at this point in the history
… environment
  • Loading branch information
abujeda committed Apr 25, 2022
1 parent 5fb17f6 commit 1da512d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
16 changes: 14 additions & 2 deletions dashboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,30 @@ ifneq ($(shell git branch --show-current),stable)
NPM_RUN_VERSION_ARGS := --config='.release-it-dev.json'
endif

TEMPLATE_LOCATION := ./application/lib/ood_core/batch_connect/templates
TURBOVNC_TEMPLATE := turbovnc.rb
KVM_TEMPLATE := kvm.rb

remote-dev clean-remote-dev: LOGIN_HOST := login.rc.fas.harvard.edu
remote-dev clean-remote-dev: APP_FOLDER := ./fasrc/dev/dashboard
remote-dev: TEMPLATE_URL := https://vdi.rc.fas.harvard.edu/pun/sys/dashboard/files/fs/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.12/gems/ood_core-0.17.1/lib/ood_core/batch_connect/templates

remote-fasse clean-remote-fasse: LOGIN_HOST := fasselogin.rc.fas.harvard.edu
remote-fasse clean-remote-fasse: APP_FOLDER := ./.fasseood/dev/dashboard
remote-fasse: TEMPLATE_URL := https://fasseood.rc.fas.harvard.edu/pun/sys/dashboard/files/fs/opt/ood/ondemand/root/usr/share/gems/2.7/ondemand/2.0.16/gems/ood_core-0.17.6/lib/ood_core/batch_connect/templates
remote-fasse: HTTP_PROXY := http://rcproxy.rc.fas.harvard.edu:3128
remote-fasse: HTTPS_PROXY := http://rcproxy.rc.fas.harvard.edu:3128

dev: version down up

remote-dev remote-fasse: version
$(ENV) docker-compose build
echo "For FASSE, you need to be connected to the VPN"
$(ENV) http_proxy=$(HTTP_PROXY) https_proxy=$(HTTPS_PROXY) docker-compose build
@echo "You need to be connected to the VPN"
ssh $(REMOTE_USERNAME)@$(LOGIN_HOST) mkdir -p $(APP_FOLDER)
$(ENV) docker-compose run --no-deps --entrypoint="" ood su - ood bash -c "export PATH=/home/ood/bin:/home/ood/ondemand/dev/dashboard/node_modules/.bin:$$PATH; cd /home/ood/ondemand/dev/dashboard; scl enable rh-ruby27 rh-nodejs12 'gem install --user-install bundler -v 2.1.4 && bundle config --local path 'vendor/bundle' && bundle install && npm install yarn --save && bundle exec rake assets:precompile'"
@echo "You need to be connected to the VPN"
@./download_and_check.sh $(REMOTE_USERNAME) $(TEMPLATE_URL)/$(TURBOVNC_TEMPLATE) $(TEMPLATE_LOCATION)/$(TURBOVNC_TEMPLATE)
@./download_and_check.sh $(REMOTE_USERNAME) $(TEMPLATE_URL)/$(KVM_TEMPLATE) $(TEMPLATE_LOCATION)/$(KVM_TEMPLATE)
rsync -avz --delete --exclude-from='rsync-exclude.conf' ./application/ -e ssh $(REMOTE_USERNAME)@$(LOGIN_HOST):$(APP_FOLDER)

test:
Expand Down
13 changes: 9 additions & 4 deletions dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ Docker images are used to create the local development environment. Information

To thoroughly purge your Docker environment, also run `docker volume prune; docker system prune -a` and restart Docker.

## Deploying to remote development (your FASRC account)

- Run `make remote-dev`. `make remote-dev` builds all required OOD/Ruby libs locally and exports built artifacts to FASRC. This task will prompt you for your FASRC SSH credentials (password and pin) twice as it creates/validates the pre-requisite directory structure as setup in your home directory.
## Deploying to remote development (your FASRC/FASSE account)
### Cannon
- Run `make remote-dev`. `make remote-dev` builds all required OOD/Ruby libs locally and exports built artifacts to FASRC. This task will prompt you for your FASRC credentials (password and pin) more than once as it retrieves files, creates/validates the pre-requisite directory structure, and deploys the app to your home directory.

- Once completed, visit:

https://vdi.rc.fas.harvard.edu

and go through the same Validation process as for the development environment.
### FASSE
- Run `make remote-fasse`. `make remote-fasse` builds as before and deploys to FASSE. This task will prompt you for your FASRC credentials (password and pin) more than once as it retrieves files, creates/validates the pre-requisite directory structure, and deploys the app to your home directory.

- Once completed, visit:

https://fasseood.rc.fas.harvard.edu

## Support ticket attachments
There are restrictions in place for the attachments. There is client side validation:
Expand Down
2 changes: 1 addition & 1 deletion dashboard/docker/Dockerfile.slurm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN groupadd -g $OOD_GID ood || : && \
mv TurboVNC.repo /etc/yum.repos.d/ && \
curl -L https://download2.rstudio.org/rstudio-server-rhel-1.1.463-x86_64.rpm -o rstudio-server-rhel-1.1.463-x86_64.rpm && \
yum install -y epel-release && \
yum install -y nc openssh-server turbovnc python-websockify nc R rstudio-server-rhel-1.1.463-x86_64.rpm && \
yum install -y nc openssh-server turbovnc-2.2.5-20200507 python-websockify nc R rstudio-server-rhel-1.1.463-x86_64.rpm && \
yum -y groupinstall 'MATE Desktop' && \
mkdir -p /apps && \
mkdir -p /run/sshd && \
Expand Down
17 changes: 17 additions & 0 deletions dashboard/download_and_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

REMOTE_USERNAME="$1"
FILE_TEMPLATE_URL="$2"
SAVE_LOCATION="$3"

echo "Downloading: $FILE_TEMPLATE_URL"
curl -sSL $FILE_TEMPLATE_URL --user $REMOTE_USERNAME -o $SAVE_LOCATION
echo "Checking: $SAVE_LOCATION"
grep -q 'require "ood_core/refinements/hash_extensions"' $SAVE_LOCATION
check_result=$?
if [ $check_result -ne 0 ]; then
echo "❌ invalid template: $SAVE_LOCATION"
exit 1
fi

echo "✅ valid template: $SAVE_LOCATION"

0 comments on commit 1da512d

Please sign in to comment.