Install in Single Server mode
Run the Backend as a service in Single Server mode, with TLS and a static list of users.
Other ways: Install in cloud with Terraform, Install in custom infrastructure.
Single Server modeSingle Server mode — The mode in which the Backend and all its jobs run on one Linux machine, the server, with no Kubernetes cluster. Glossary is the fastest way to start: for a test or for a small team. To choose the environment, see Choose an installation path.
What you get
In Single Server mode, the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary binary runs on a Linux server, and all its parts stay there: the database, the workspaceworkspace — The storage where the Backend and all jobs keep the working files of running jobs. The Backend and the jobs use it at the same time. In Kubernetes, it is a network file system; in Single Server mode, it is a folder on the server. Glossary, the results and the jobsjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary. When Docker is on the server and turned on for the Backend, each job runs in its own container; otherwise, the jobs run as processes of the system user of the Backend. For the server, see Requirements of Single Server mode.
- Primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary: the folder
primaryin the data folder/data/platforma. In this case, the Backend also shares the file system of the server with all users as the host library: see Host library, and turn it off when users do not need it. Workspace: the folderworkin the data folder. - Sign-insign in — To show the Backend who you are, with a sign-in provider or a single-user token. The verb is "sign in"; the noun and the adjective are "sign-in". Glossary: the static list of usersstatic list of users — A sign-in provider that is a file with the logins and the password hashes of the users, in the htpasswd format. The Backend reads it again when it changes. Glossary in
/etc/platforma/users.htpasswd;adminis an administrator. When the file changes, the Backend reads it again. - Entry pointentry point — The way in to the Backend from outside the cluster, a load balancer or an Ingress with a DNS name. It usually ends TLS and sends the traffic to the Backend pod. Glossary and TLS: the Backend itself listens on all addresses, on port 6345 for the API
and on port 6347 for the files of the primary storage (see Open ports).
It uses TLS from PEM files for the host name
that users type in the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary, for example
platforma.example.com. See Connect clients.
Size. The size follows the memory and the CPUsCPUs — The compute units of a node or of the server, as Kubernetes and the operating system count them. A job asks for a number of CPUs. The cloud quotas call them vCPUs. Glossary of the server. On a server with 256 GiB of memory, up to 7 biggest jobs of samples of 10 M reads run at the same time, or 3 of samples of 100 M reads. A project of 100 such samples then runs in about 34 rounds of the biggest jobs. A server with 128 GiB, the minimum, runs samples of 100 M reads only when they are not very diverse. For the details, see Size and cost of an analysis and Memory.
Before you start
Prepare these items before you start:
- The server meets the Requirements of Single Server mode: Linux on amd64, the memory, the disk and the network access.
- Rights. Root rights on the server, to make the system user and the service. See Single Server mode in Permissions.
- A host name and a certificate. The host name that users type in the Desktop App, for example
platforma.example.com, a DNS record from it to the server, and a certificate for this name with its private key, as PEM files. The computers of the users must reach ports 6345 and 6347 of the server: see Open ports. For a test without a certificate authority, see Self-signed certificate. - The license key. See License.
- Tools on the server:
curl,opensslandhtpasswd(the packageapache2-utilsorhttpd-tools). Docker is optional: when you turn it on for the Backend, each job runs in its own container.
The jobs get their software from the registries of MiLaboratories: without Docker as software archives, with Docker as images. When the server cannot reach them, see Restricted network mode and Software packages and assets.
Steps
Run the commands on the server, as a user with sudo.
-
Make the system user of the Backend and its folders. The data folder
/data/platformaholds the database, the workspace and the results: put it on the large disk.Terminal window sudo useradd --system --home-dir /data/platforma --shell /usr/sbin/nologin platformasudo mkdir -p /data/platforma /opt/platforma /etc/platforma/tlssudo chown platforma:platforma /data/platformaWith Docker, also add the user to the group
docker:sudo usermod -aG docker platforma. This gives the user root rights on the server: see Rights in Single Server mode.To put the parts of the data folder on other disks, or the results into a bucket, see Storage.
-
Get the Backend. The archive holds the Backend and the files that it needs next to it: keep them together.
Terminal window curl -fL -o /tmp/platforma.tgz https://dl.platforma.bio/software/platforma-backend/pl-linux-amd64.tgzsudo tar -xzf /tmp/platforma.tgz -C /opt/platforma/opt/platforma/binaries/platforma --versionResult: the command shows the version of the Backend.
-
Put the secret values into files. The license key goes into an environment file, and the master secret into a file that only the Backend reads. Do not give them as options: other users of the server can see the command line of a process. Keep a copy of the master secret in a safe place: a new master secret signs out all users (see The secrets of Platforma).
Terminal window openssl rand -base64 32 | tr -d '\n' | sudo tee /etc/platforma/master-secret > /dev/nullsudo chgrp platforma /etc/platforma/master-secret && sudo chmod 640 /etc/platforma/master-secretprintf 'PL_LICENSE=%s\nPL_MASTER_SECRET_FILE=/etc/platforma/master-secret\n' '<license key>' \| sudo tee /etc/platforma/platforma.env > /dev/nullsudo chmod 600 /etc/platforma/platforma.envsudo htpasswd -cB /etc/platforma/users.htpasswd admin # asks for the password of adminsudo chgrp platforma /etc/platforma/users.htpasswd && sudo chmod 640 /etc/platforma/users.htpasswdFor other sign-in providerssign-in provider — A configured way for users to sign in to the Backend: single sign-on (SSO), LDAP or a static list of users. One Backend can have more than one. Glossary, see Authentication, and for the administrators, see Users and roles.
-
Copy the certificate and its private key.
Terminal window sudo cp tls.crt tls.key /etc/platforma/tls/sudo chgrp platforma /etc/platforma/tls/tls.key && sudo chmod 640 /etc/platforma/tls/tls.keyFor a test without a certificate authority, skip this step, and in step 5 replace
--listen-tls …with--self-signed-tls --self-signed-tls-domain platforma.example.com. The Backend then writes the certificate to/data/platforma/tls/certificate.cer. Each computer with the Desktop App must trust this certificate: see Self-signed certificate. -
Run the Backend as a service. The service starts the Backend with the server, and starts it again after a failure.
/etc/systemd/system/platforma.service [Unit]Description=Platforma BackendAfter=network-online.targetWants=network-online.target[Service]User=platformaGroup=platformaEnvironmentFile=/etc/platforma/platforma.envExecStart=/opt/platforma/binaries/platforma --main-root /data/platforma \--listen-address 0.0.0.0 \--listen-tls /etc/platforma/tls/tls.crt,/etc/platforma/tls/tls.key \--primary-storage-fs-url https://platforma.example.com:6347 \--auth.provider-id=local \--auth.provider-type=local=htpasswd \"--auth.title=local=Local password" \--auth.htpasswd.file=local=/etc/platforma/users.htpasswd \--auth.admin-user=local=adminRestart=on-failureLimitNOFILE=500000[Install]WantedBy=multi-user.targetTo run the jobs in Docker containers, add the line
Environment=PL_RUNNER_ENABLE_DOCKER=trueto the section[Service]. Without it, the jobs run as processes, also when Docker is on the server.Terminal window sudo systemctl daemon-reloadsudo systemctl enable --now platformasystemctl status platformaThe option
--primary-storage-fs-urlgives the data address, where the Desktop App uploads and downloads the files: the host name of the server and port 6347. Without it, the address ishttps://0.0.0.0:6347, and the Desktop App cannot reach it. See Open ports.Result: the service is
active (running). The logs of the Backend are in/data/platforma/log/. When the license key is not valid, the service also runs, but the log hasLicense verification failed, and the Backend does not run jobs: see License.To limit the memory and the CPUs of the jobs, see Jobs and resources. For a proxy or a corporate certificate authority, see Proxy and custom CA. For data librariesdata library — A folder or bucket with input data of the company. Users select files from it in the Desktop App. Platforma only reads it. Glossary and the host library, see Data libraries. For mirrors of the registries, see Registries.
-
Check the ports and the certificate, from a computer of a user:
Terminal window openssl s_client -connect platforma.example.com:6345 -servername platforma.example.com \-verify_hostname platforma.example.com -verify_return_error -alpn h2 </dev/null >/dev/null 2>&1 \&& echo "6345: certificate OK"openssl s_client -connect platforma.example.com:6347 -servername platforma.example.com \-verify_hostname platforma.example.com -verify_return_error </dev/null >/dev/null 2>&1 \&& echo "6347: certificate OK"Result:
certificate OKfor each port. When a line does not show, the certificate of this port is not valid for the host name: run itsopensslcommand again without>/dev/null 2>&1to see the error. With a self-signed certificate, or a certificate of a corporate certificate authority that the computer does not trust, add-CAfile <file of the certificate>to the command. For the other TLS settings, see TLS on the Backend. -
Verify the installation. See Verify the installation.
-
Connect the Desktop App to
platforma.example.com, port 6345, and sign in asadminwith the password of the list of users. See Connect clients.