|
| 1 | +LinuxONE |
| 2 | +******** |
| 3 | + |
| 4 | +Overview |
| 5 | +======== |
| 6 | +LinuxForHealth is deployable to amd64, s390x and arm64 (aarch64) platforms and may be built to support other chip architectures. These instructions explain how to bring up a LinuxONE VM from scratch and were tested with a VM from the IBM LinuxONE OSS Community Cloud. All steps are executed on the LinuxONE VM, with the exception of the initial steps to deploy the VM. |
| 7 | + |
| 8 | +Prerequisites |
| 9 | +============= |
| 10 | +- An ssh utility such as OpenSSH must be installed on the computer you will use to connect to your LinuxONE VM. |
| 11 | + |
| 12 | +Deploy a LinuxONE VM |
| 13 | +==================== |
| 14 | +These instructions explain how to deploy a new LinuxONE VM in the IBM LinuxONE OSS Community Cloud. If you already have a LinuxONE VM running Ubuntu 20.04, skip to the next section. If you do not have an account in the IBM LinuxONE OSS Community Cloud, you can start with `Getting started with LinuxONE <https://developer.ibm.com/gettingstarted/ibm-linuxone>`_, where you can sign up for a free trial. |
| 15 | + |
| 16 | +1. Create an ssh key pair to use to ssh into the VM you will create. Provide a file name when requested. In this case, we used ``lfhcommvm1`` with no path, which creates the key pair in the current directory:: |
| 17 | + |
| 18 | + cd ~/.ssh |
| 19 | + ssh-keygen -t rsa |
| 20 | + |
| 21 | +2. Log into the `IBM LinuxONE OSS Community Cloud <https://linuxone.cloud.marist.edu/oss/#/login>`_ and click "Manage Instances" in the "Service Catalog". |
| 22 | + |
| 23 | +3. Click "Create" and populate the fields. Choose "General Purpose VM", provide a name for the VM, select the Ubuntu 20.04 image, select the LinuxONE flavor, and elect to import the public key (.pub) that you created in a previous step. |
| 24 | + |
| 25 | +.. image:: /images/CreateLinuxONEVM.png |
| 26 | + :width: 600 |
| 27 | + |
| 28 | +4. Click "Create" and wait a few minutes for your VM to start. Once started, note the IP address of your new VM. |
| 29 | + |
| 30 | +5. Configure your computer to ssh into your new VM. For example, you can add this section to your OpenSSH .ssh/config file:: |
| 31 | + |
| 32 | + Host lfh-comm-vm1 |
| 33 | + HostName <your VM's IP> |
| 34 | + User linux1 |
| 35 | + IdentityFile ~/.ssh/lfhcommvm1 |
| 36 | + |
| 37 | +6. ssh into your LinuxONE VM:: |
| 38 | + |
| 39 | + ssh lfh-comm-vm1 |
| 40 | + |
| 41 | +Configure the Python Environment |
| 42 | +================================ |
| 43 | +On your LinuxONE VM, run the following commands to install python, pip and pipenv:: |
| 44 | + |
| 45 | + sudo apt-get update |
| 46 | + sudo apt install python3-pip |
| 47 | + pip install --upgrade pip |
| 48 | + pip3 install pipenv |
| 49 | + |
| 50 | +Add ``PATH=/home/linux1/.local/bin:$PATH`` to your ~/.bashrc file and run:: |
| 51 | + |
| 52 | + source .bashrc |
| 53 | + |
| 54 | +Install Docker and docker-compose |
| 55 | +================================= |
| 56 | +Install docker and docker-compose via the following steps:: |
| 57 | + |
| 58 | + sudo snap install docker |
| 59 | + sudo groupadd docker |
| 60 | + sudo usermod -aG docker $USER |
| 61 | + sudo snap start docker |
| 62 | + |
| 63 | +Reboot for the user group changes to take effect:: |
| 64 | + |
| 65 | + sudo reboot |
| 66 | + |
| 67 | +Build and Install librdkafka |
| 68 | +================================= |
| 69 | +Build and install librdkafka. Note that this step is necessary to make the correct version of librdkafka available on this platform:: |
| 70 | + |
| 71 | + git clone https://github.com/edenhill/librdkafka.git |
| 72 | + cd librdkafka |
| 73 | + ./configure |
| 74 | + make |
| 75 | + sudo make install |
| 76 | + sudo ldconfig |
| 77 | + cd .. |
| 78 | + |
| 79 | +Configure and Run LinuxForHealth connect |
| 80 | +======================================== |
| 81 | +Clone and configure LinuxForHealth connect:: |
| 82 | + |
| 83 | + git clone https://github.com/LinuxForHealth/connect.git |
| 84 | + cd connect |
| 85 | + cp platforms/s390x/Dockerfile . |
| 86 | + cp platforms/s390x/docker-compose.yml . |
| 87 | + |
| 88 | +Create a virtual environment:: |
| 89 | + |
| 90 | + pipenv sync --dev |
| 91 | + |
| 92 | +Bring up the LinuxForHealth services:: |
| 93 | + |
| 94 | + docker-compose up -d nats-server ipfs-node-0 zookeeper kafka ipfs-cluster-0 |
| 95 | + |
| 96 | +Start connect:: |
| 97 | + |
| 98 | + pipenv run connect |
| 99 | + |
| 100 | + |
| 101 | +Send a Message to LinuxForHealth |
| 102 | +================================ |
| 103 | +Follow the `Quickstart steps </tutorials/quickstart.html#send-a-message-to-linuxforhealth>`_ to send a message to LinuxForHealth. Be sure to use the IP of your VM in the OpenAPI /docs URL. |
0 commit comments