Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Sep 4, 2024
1 parent b8b0cb4 commit 06aece3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ returns:
exercise-materials wis2box-1.0b8
```

You can use WinSCP to connect to your instance and inspect the contents of your home directory and download or upload files between your VM and your local PC.
If you have WinSCP installed on your local PC, you can use it to connect to your student VM and inspect the contents of your home directory and download or upload files between your VM and your local PC.

WinSCP is not required for the training, but it can be useful if you want to edit files on your VM using a text editor on your local PC.

Here is how you can connect to your student VM using WinSCP:

Open WinSCP and click on the "New Site". You can create a new SCP connection to your VM as follows:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ The synop2bufr plugin relies on a file-pattern to extract the date from the file

The filename was used to determine the year and month of the data sample.

## Exercise 5: ingesting data using the wis2box-ftp service
## Exercise 4: ingesting data using the wis2box-ftp service

You can add an additional service that adds an ftp-endpoint on your wis2box-instance. This service will forward data uploaded via ftp to the MinIO storage service, preserving the directory structure of the uploaded data.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Note that MQTT is primarily used for "machine-to-machine" communication; meaning

To view messages published by a WIS2 Global Broker you can "MQTT Explorer" which can be downloaded from the [MQTT Explorer website](https://mqtt-explorer.com).

Open MQTT Explorer and add a new connection to the Global Broker hosted by China Meteorological Administration using the following details:
Open MQTT Explorer and add a new connection to the Global Broker hosted by MeteoFrance using the following details:

- host: globalbroker.meteo.fr
- port: 8883
Expand Down
41 changes: 14 additions & 27 deletions environment/setup_student_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,24 @@ read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][e
# execute commands over ssh

# create the user, if not already existing
ssh wmo_admin@`echo $HOST_IP` "sudo useradd "$USERNAME" -m -G docker --shell /bin/bash"
ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "sudo useradd "$USERNAME" -m -G docker --shell /bin/bash"
# set the initial password to "wis2training"
ssh wmo_admin@`echo $HOST_IP` "echo "$USERNAME":wis2training | sudo chpasswd"
ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "echo "$USERNAME":wis2training | sudo chpasswd"
# rename the hostname to student-vm-<USERNAME>
ssh wmo_admin@`echo $HOST_IP` "sudo hostnamectl set-hostname student-vm-`echo $USERNAME`"
ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "sudo hostnamectl set-hostname student-vm-`echo $USERNAME`"

# copy the latest wis2box-setup-1.0b5.zip to the student-vm
ssh wmo_admin@`echo $HOST_IP` "wget https://github.com/wmo-im/wis2box/releases/download/1.0b5/wis2box-setup-1.0b5.zip -O /tmp/wis2box-setup-1.0b5.zip"
# unzip the wis2box-setup-1.0b5.zip
ssh wmo_admin@`echo $HOST_IP` "sudo unzip -o /tmp/wis2box-setup-1.0b5.zip -d /home/`echo $USERNAME`/"
# remove the wis2box-setup-1.0b5.zip
ssh wmo_admin@`echo $HOST_IP` "rm -rf /tmp/wis2box-setup-1.0b5.zip"
# copy the latest wis2box-setup-1.0b8.zip to the student-vm
ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "wget https://github.com/wmo-im/wis2box/releases/download/1.0b8/wis2box-setup-1.0b8.zip -O /tmp/wis2box-setup-1.0b8.zip"
# unzip the wis2box-setup-1.0b8.zip
ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "sudo unzip -o /tmp/wis2box-setup-1.0b8.zip -d /home/`echo $USERNAME`/"
# remove the wis2box-setup-1.0b8.zip
ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "rm -rf /tmp/wis2box-setup-1.0b8.zip"

# copy the latest exercise materials to the student-vm
ssh wmo_admin@`echo $HOST_IP` "wget https://training.wis2box.wis.wmo.int/exercise-materials.zip -O /tmp/exercise-materials.zip"
ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "wget https://training.wis2box.wis2dev.io/exercise-materials.zip -O /tmp/exercise-materials.zip"
# unzip the exercise-materials.zip
ssh wmo_admin@`echo $HOST_IP` "sudo unzip -o /tmp/exercise-materials.zip -d /home/`echo $USERNAME`/"
ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "sudo unzip -o /tmp/exercise-materials.zip -d /home/`echo $USERNAME`/"
# remove the exercise-materials.zip
ssh wmo_admin@`echo $HOST_IP` "rm -rf /tmp/exercise-materials.zip"

# create ftp.env
ssh wmo_admin@`echo $HOST_IP` "echo MYHOSTNAME=`echo $USERNAME`.wis2.training > /tmp/ftp.env"
ssh wmo_admin@`echo $HOST_IP` "echo FTP_USER=wis2box >> /tmp/ftp.env"
ssh wmo_admin@`echo $HOST_IP` "echo FTP_PASS=wis2box >> /tmp/ftp.env"
ssh wmo_admin@`echo $HOST_IP` "echo FTP_HOST=`echo $USERNAME`.wis2.training >> /tmp/ftp.env"
ssh wmo_admin@`echo $HOST_IP` "echo "WIS2BOX_STORAGE_ENDPOINT=http://`echo $USERNAME`.wis2.training:9000" >> /tmp/ftp.env"
ssh wmo_admin@`echo $HOST_IP` "echo WIS2BOX_STORAGE_USERNAME=minio >> /tmp/ftp.env"
ssh wmo_admin@`echo $HOST_IP` "echo WIS2BOX_STORAGE_PASSWORD=minio123 >> /tmp/ftp.env"
ssh wmo_admin@`echo $HOST_IP` "echo LOGGING_LEVEL=WARNING >> /tmp/ftp.env"
ssh wmo_admin@`echo $HOST_IP` "sudo cp /tmp/ftp.env /home/`echo $USERNAME`/wis2box-1.0b8/"
# remove /tmp/ftp.env
ssh wmo_admin@`echo $HOST_IP` "rm -rf /tmp/ftp.env"

ssh wmo_admin@`echo $HOST_IP` "sudo chown -R `echo $USERNAME`:`echo $USERNAME` /home/`echo $USERNAME`"
ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "rm -rf /tmp/exercise-materials.zip"

ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "sudo chown -R `echo $USERNAME`:`echo $USERNAME` /home/`echo $USERNAME`"

0 comments on commit 06aece3

Please sign in to comment.