Installing TIM
The Interactive Material (TIM) consists of the TIM source code and the services that run the code. The services and all runtime dependencies are packaged as Docker containers to facilitate installation. The installation of TIM consists of three steps: installing the dependencies, downloading the source code and running TIM.
This guide applies to both TIM system integrators and TIM developers. Developer-specific instructions are separated by the text "for Developers".
1. System requirements
The requirements to run TIM depend on the expected number of concurrent online users. The specifications below are estimates based on the tests with the official instance of University of Jyväskylä (JYU-TIM):
Hardware
- Disk: SSD, min. 25 GB, of which 18 GB must be on the primary disk
- RAM: min. 8 GB + 4 GB for every 100 concurrent online users
- Developers: recommended min. 16 GB to run all development-time programs
- CPU: x86_64 (i.e. Intel x86-compatible 64-bit processor or its emulator); 1 core for every 100 concurrent online users
- Developers: in development mode, TIM is always run in a single process, but a multi-core processor is recommended for development programs
Operating system TIM can be used on any system that supports Docker. System-specific requirements:
- Linux: any distribution running Linux kernel 3.10 or later
- You can check your distribution's kernel version by running
uname -r
- Linux is the preferred system on which the production instance should run
- You can check your distribution's kernel version by running
- Windows: Windows 10 21H1 (build 19041) or later, Windows 11 21H2 or later
- Windows installation requires that the hardware supports Hyper-V virtualization. You can check this by running the
systeminfo
command on Windows and looking at theHyper-V Requirements
entry that announces it.
- Windows installation requires that the hardware supports Hyper-V virtualization. You can check this by running the
- macOS: macOS 10.15 (Catalina) or later
- Devices with Apple silicon processor need the Rosetta 2 app (macOS should install it automatically).
2. Install approach 1: using the quick installation script
If
- you install TIM on a Linux machine (Ubuntu, RHEL 8+, CentOS 8+, Arch), and
- you install TIM for production use (i.e. NOT for developers)
you can use the quick install script by running:
curl -sL https://get.tim.education/linux.sh | bash -s - --profile prod
The script will automatically install all dependencies for a production run to /opt/tim
and will start a minimal TIM installation. After installation, you should customize tim.conf
to your needs.
This installation method is so far only experimental and has only been tested on a few empty machines. If you are unsure about using this method, please install all tools manually using the instructions in section 3 below!
The TIM development environment can be installed with a single installation script that requires minimal interaction with installers. The installation script installs all dependencies, PyCharm development environment and the TIM system.
Requirements:
- You must have root access (
sudo
on Linux, Admin on Windows) - The computer should not have TIM (or its dependencies) already installed
- The script overwrites all installations with the latest versions
Linux (Ubuntu, RHEL, CentOS, Fedora, Arch)
Run in shell:
curl -sL https://get.tim.education/linux.sh | bash -s - --profile dev
Script loads all installation files to the path ~/.tim-install
Windows 11
Run in PowerShell:
. { iwr -useb https://get.tim.education/windows.ps1 } | iex; install -InstallProfile dev
Notes for Windows installation script:
- The script will restart the computer twice
- After the first restart, you must accept the Docker terms of use (which will appear on the screen)
- The script can be rerun if necessary if there are errors during the run
- TIM will be installed in the path
C:\tim
. If this needs to be changed, add-Destination polku
to the script above , wherepolku
is the folder where TIM will be installed - On university machines, the installation script may not continue automatically, or from where it left off before the reboot. The installation can then be continued as follows: - After the first restart, run the command
. { iwr -useb https://get.tim.education/windows.ps1 } | iex; install -InstallProfile dev -Stage "UpdateWSL2"
- After the second restart, run the command. { iwr -useb https://get.tim.education/windows.ps1 } | iex; install -InstallProfile dev -Stage "InstallTIM"
- In the admin-Powershell If you install TIM somewhere other than C:, add-Destination "path"
to the end of the command, wherepath
is the name of the folder or the file system path.
3. Approach 2: Installing TIM and dependencies manually
TIM needs the following software installed:
- Docker Engine and Docker Compose
- Developers: you can install instead Docker Desktop, which includes all necessary Docker dependencies
- Python 3.6 or later (developers: install the latest version, currently 3.10)
- Windows: in the installer, select Add Python to environment variables
- Git 1.8 or later
- Developers: Node.JS (any LTS version) and NPM 6.x
- Note: NPM version can be different from 6.x by default. See additional instructions below.
- Any shell interpreter; below is a list of tested and proven interpreter:
- Linux POSIX-compatible shell interpreters:
bash
,zsh
,fish
,sh
, ... - macOS built-in shell
- Git Bash (Windows)
- MINGW and MSyS shell interpreters (Windows)
- WSL2 Bash (Windows) WSL2 Bash (Windows)
- Linux POSIX-compatible shell interpreters:
Other software will be installed automatically when you install TIM. You can view the explanations of all the programs used in TIM in the service documentation.
The dependency-specific instructions below explain how to install the different programs and how to configure.
3.1 Developers: Docker Desktop
Docker Desktop comes with all the dependencies for deploying Docker in development.
3.1.1 Linux
Official installation instructions
- First check if Docker can be found in the distribution's own package manager
- Instead of Docker Desktop, you can install Docker + Docker Compose separately. Most distributions provide separately the
docker
package and thedocker-compose
package - If you cannot find
docker-compose
as a package in your distribution, you can proceed as follows:- Run
docker compose version
. If you get a version (e.g.Docker Compose version v2.x.x
), you already have Docker Compose installed - Otherwise, you can install the script manually: Install Compose manually (search on
Compose standalone
, which is the easiest way to install compose)
- Run
3.1.2 Windows
Official installation instructions
- In the installer, make sure that the Use WSL 2 instead of Hyper-V checkbox is selected
- The Docker Desktop installer should automatically configure your computer to work with virtualization. If this does not happen, you can do this manually: Docker official instructions
- Docker Desktop installer also installs Windows Subsystem for Linux 2 (WSL2) automatically. If this fails for some reason, you can manually install WSL2 using Microsoft's instructions
- Docker Desktop may ask you to reboot the system a few times and install additional dependencies (e.g. WSL2 Linux kernel). Follow the instructions of the Docker Desktop installer
3.2 Developers: NodeJS
On Linux, LTS (long-term support) versions of Node.JS are often available directly from the package manager
The TIM system is currently using NPM 6.x in development due to various legal and performance issues with newer versions. First check your NPM version by running
npm --version
if the output is anything other than version 6, the version must be downgraded with the command
npm install --global npm@6
Finally, check that the version is set correctly.
- Note that TIM needs NPM version 6! If you need a different NPM version for your own development, you can use NVM for Windows or nvm.sh
Lisähuomio
Jos TIMia käynnistäessä/asentaessa bdw
-skripti kaatuu virheeseen, katso tarkemmat ohjeet täältä.
4. Downloading TIM source
After installing the dependencies, the source code of TIM can be downloaded. Download TIM from GitHub:
Developers: Create SSH keys and install them on GitHub.
Go to the directory where TIM will be installed
Run the shell
If you have push access to the TIM repo(developers):
git clone git@github.com:TIM-JYU/TIM.git tim
If you do not have push permission:
git clone https://github.com/TIM-JYU/TIM.git tim
5. Configuring and running
TIM is configured using the TIM Command Line Interface (TIM CLI).
Open the shell interpreter and go to the downloaded TIM instance folder
Run
./tim setup
Follow the configuration program instructions
- Select a run profile. There are two main options:
prod
: configure the TIM instance for "production use"dev
: configure the TIM instance for development use(for developers)
- With
prod
profile, the tool asks you to enter additional settings, such as the address of the TIM instance and the ports used by the instance
- Select a run profile. There are two main options:
Follow the installation progress: TIM loads the Docker images, compiles the browser code and runs all services up If any step fails, you can later re-run the configuration using the command
./tim setup --force
The TIM system is then up and running. Test that you can access the TIM home page:
- In
prod
profile, the address is the configured address - (developers) In
dev
profile, the address ishttp://localhost
- If everything works, you will see the message "TIM Caddy is running!"
5.1 Creating a new user
TIM already has three test users named testuser1
, testuser2
and testuser3
(see maintenance guide) but no maintenance user.
Create a new maintenance domain with the command
./tim run flask user create
6. Most common maintenance commands
Maintenance of the TIM instance is primarily done with the TIM CLI tool (./tim
script in the TIM directory).
The most common commands for basic use:
./tim up
: restarts all containers, restarting them if necessary (e.g. due to a configuration change)./tim restart
: restarts all containers./tim update all
: performs a full TIM system update (downloads containers, compiles JavaScript)- Note: This does not update the source code itself. You can do this e.g. at
git pull
or similar.
- Note: This does not update the source code itself. You can do this e.g. at
Less common, but still useful commands
./tim js
: recompile JavaScript code./tim dc down
: shut down the TIM system./tim run flask
: maintenance commands for TIM babble. Includes commands to create and manage (admin) users, for example.
7. Next
- Installation and configuration issues
- General maintenance (including instructions for the TIM CLI tool)
- Developers: (in Finnish) Installing the PyCharm development environment
- Developers: (in Finnish) General developer functions and instructions
These are the current permissions for this document; please modify if needed. You can always modify these permissions from the manage page.