Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Funtoo User Services/Mottainai Project

From Funtoo
Jump to navigation Jump to search
   Summary
The Mottainai Linux project is a new project to integrate CD/CI workflow to improve QA.
   People
Leads
   Latest Status

Mottainai Server now has a Community Mode to help on sharing results of the executed tasks for testing/QA. Mottainai Dashboard v0.2.4 has been released.

25 April 2022

MottainaiCI is a young CD/CI Service that is born under the Sabayon umbrella and now want be part of the Funtoo world. It permits to integrate tasks or pipelines over LXD containers or Docker containers. It's used by the Macaroni project to manage the creation of the binaries packages used by luet.

One of the mission of this project is to create a catalog of Mottainai specs related to tasks and pipelines that the users can be uses to verify their fixes before open a PR, etc.

Staff Howto

The mottainai CI uses API REST with a Token to manage the tasks/pipelines to execute.

1. Create User

So, the first thing to do is the creation of the your user inside the Mottainai Funtoo instance at https://mottainaici.funtoo/ over the Sign In button.

2. Create Token

After completed the registration over the User icon, select the button <user> -> API Token menu and then create the token with the `New Token` button.

3. Install and Setup CLI

In this moment, there isn't the ebuild for the `mottainai-cli` tool and the faster way to start is follow these steps and install the package with luet:

funtoo # wget https://raw.githubusercontent.com/geaaru/luet/geaaru/contrib/config/get_luet_root.sh -O ./get_luet_root.sh
funtoo # sh ./get_luet_root.sh
funtoo # luet i -y dev-util/mottainai-cli

When the tool is installed it's possible to use the CLI in different ways:

a) To pass the server URL and token from CLI directly:

funtoo # mottainai-cli -m https://mottainaici.funtoo/ -k <TOKEN> <command>

b) Create a profile with this command:

funtoo # mottainai-cli profile create funtoo https://mottainaici.funtoo/mottainai <MY-TOKEN>

In the example the name of the profile is `funtoo`.

The creation of the profile permit to use the `mottainai-cli` then in these ways:

funtoo # mottainai-cli task list -p funtoo
funtoo # export MOTTAINAI_CLI_PROFILE=funtoo && mottainai-cli task list

4. Create your first task

It's now time to create your first task and check your setup.

funtoo # echo "
name: \"My first task\"
type: lxd
image: macaroni/funtoo-builder
script:
- env
- echo \"Helloworld!\"
" > mytask.yaml
funtoo # mottainai-cli task create --yaml mytask.yaml

and then to attach the terminal to the running task:

funtoo # mottainai-cli task attach <ID>

or if the task is complated:

funtoo # mottainai-cli log <ID>