Torii is a powerful open-source Internal Developer Portal designed to simplify the lives of developers by providing easy access to the tools and services they need. In this guide, we will walk you through the steps to get started with Torii, its features, and some troubleshooting tips to make your experience smooth and enjoyable.
Understanding the Core Principles of Torii
Torii is built around three fundamental principles that aim to enhance your development experience:
- Easily Configurable: You can define a catalog of tools and services for developers, including scorecards and workflows for each.
- Easily Usable: A simple web interface allows developers to find and utilize the necessary tools effortlessly.
- Easily Extensible: Platform Engineers can add new tools and services to Torii’s catalog, ensuring it’s always up to date.
Getting Started
Prerequisites
Before installing Torii, ensure you meet these prerequisites:
- Operating Systems: MacOSX, Linux, or Windows
- Postgres database
Installation Steps
You can run Torii easily using Docker Compose. Here’s how:
Run with Docker Compose
docker-compose up
Running Locally
If you prefer to run it locally, you’ll need to start the Postgres DB, the backend, and the frontend separately. Here’s how:
Start Postgres
docker-compose -f docker-compose-dev.yaml up
Start the Backend
Navigate to the backend directory and run:
cd backend
cargo run -- --config examples/config.yaml
You should see some informational logs confirming that the backend is connected and running:
INFO backend: connecting to database...
INFO backend: database initialized and up to date...
INFO backend: Server listening on 0.0.0.0:9999
Start the Frontend
To get your frontend running, follow these steps:
cd frontend
npm install
npm run dev
You can access the frontend at http://localhost:3000 and the backend at http://localhost:9999.
Configuration
Simple Configuration Example
Torii is configured using a YAML file. Below is an analogy to help you understand the configuration process:
Think of Torii as a restaurant where you have a menu (the YAML configuration) containing various sections (self-service sections) and dishes (actions). Each dish has specific ingredients (fields) that the customer (developer) needs to fill in to enjoy their meal (action). Here’s a simplified configuration that creates a self-service section with an action for a new testing environment:
self_service:
sections:
- slug: default
name: Default
description: Default section
actions:
- slug: new-testing-environment
name: New Testing Environment
description: spin up a temporary testing environment
icon: target
fields:
- slug: name
title: Name
description: provide a name for your environment
placeholder: testing-123
type: text
default: testing-123
required: true
- slug: description
title: Description
description: provide a description for your environment
type: textarea
- slug: ttl
title: TTL
description: Time to live for your environment (in hours)
placeholder: 24
type: number
required: true
- slug: seed
title: Seed
description: Do you want to seed your environment with some data?
type: boolean
default: true
post_validate:
- command:
- python
- my-scripts/environment_management.py
- create
- --name
- name
delayed_command:
- command:
- python
- my-scripts/environment_management.py
- delete
- --name
- name
delay:
hours: ttl
In the above example, once a developer fills out the form (menu), Torii will execute a validation script to ensure everything is in order before serving up the testing environment.
Troubleshooting
As with any software, you might encounter challenges. Here are some common troubleshooting tips:
- If you’re unable to connect to the database, ensure Postgres is running properly.
- Check the logs for any errors during the backend startup; they may give you clues on what’s wrong.
- If you encounter issues with the frontend, ensure all npm dependencies are correctly installed.
- For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
Conclusion
Torii presents a robust solution for developers by providing an open-source Internal Developer Portal. Its flexibility and ease of use make it a suitable choice amidst other platforms like Backstage and proprietary options. Dive into Torii today, and empower your development processes!