注意:

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

In alternative you can just compile the cli from code (probably it's better the develop branch):

funtoo # git clone https://github.com/MottainaiCI/mottainai-server.git -b develop
funtoo # cd mottainai-server
funtoo # make build-cli
funtoo # sudo cp mottainai-cli/mottainai-cli /usr/bin

At the moment, the internal mottainai service is exposed with a self-signed certificate, so it's needed execute this command to use the mottainai-cli:

funtoo # echo "
-----BEGIN CERTIFICATE-----
MIIGEjCCA/qgAwIBAgIUUY+gvV+n7tzpNrNJtr0UFQjPkagwDQYJKoZIhvcNAQEL
BQAwgY4xCzAJBgNVBAYTAklUMQ4wDAYDVQQIDAVFYXJ0aDEOMAwGA1UEBwwFSXRh
bHkxITAfBgNVBAsMGE1vdHRhaW5haUNJI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yd62yecCAwEAAaNmMGQwCwYDVR0PBAQDAgTwMB0GA1UdJQQWMBQGCCsGAQUFBwMB
BggrBgEFBQcDAjA2BgNVHREELzAtghEqLm1vdHRhaW5haS5sb2NhbIISbW90dGFp
bmFpY2kuZnVudG9vhwSsEwNkMA0GCSqGSIb3DQEBCwUAA4ICAQBznDBKDE1KCEKq
De3AKpJTZgSSzEbDn+2ZL8uCIcM8m7H1vsWbw6G7w545eapSEr5mM0bF8tNAH+YZ
5+Dmxs37YiI07Gh2K/lCY//ApteSu+OGAbF41LPYdAR0W1XfBiNhoa42jhUJ6qKt
5gHP3O+6/gzSt6mr1BPHXwKo8e6ttOh+dmRazMBlDozPCwRcKGXoBfqHriP9Jv5O
wWWJbr5N+cTUru7f10+QtUUXbkOQR7WVx2YKYYPCpci0by7YrfAKCkpBpi+yQ8gg
yImJLe1eQxvQ46SuR0rTypAWfgIJrf5ItOaY+PifEMlt0s1PeQ/hFcQvik9xxsGi
MAFJn21zmLZnasS1CgSioBhma1JqPDg8sRL7Z2Bw41xqjQDoMqcCcBgXKpdLoK9v
9mk7EoOWpRcChEeRc97TLRdSFgwM4m3GIGfpngHWr5bLuZ8/21ZZMXcYTsGGNDKn
S8eTa9bIO9rBi69IPmQhex2B1TQRNBUulWc/Ez7zx90n7+lCe6BwmFpLyHRS6piL
h+woxjs0pix7Zw94PJP/G3kBAMvi54//MLhToO1vHRM7j++JGyDFx1e92Vy8NT6T
+5npWY43OIg4+QCCxzt9vwZ3liFgzKqgpfAWWIlBejjRYSTcZSKrpNFkC5Qqe5Xy
2OtKgpBqAnTjYoGpPngQuSiqJLLUfQ==
-----END CERTIFICATE-----" > /etc/ssl/certs/mottainaici-funtoo.crt

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/mottainai -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>