Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize sidebar before starting to write solution level docs #91

Merged
merged 16 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/components/elemental.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Elemental
---

https://elemental.docs.rancher.com
5 changes: 5 additions & 0 deletions docs/components/fleet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Fleet
---

https://fleet.rancher.io
5 changes: 5 additions & 0 deletions docs/components/longhorn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Longhorn
---

https://longhorn.io/docs/
3 changes: 3 additions & 0 deletions docs/components/metal3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Metal3
---
agracey marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 1 addition & 2 deletions docs/quickstart/metallb.md → docs/components/metallb.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
sidebar_position: 4
title: MetalLB on K3s
title: MetalLB
---

# Intro
Expand Down
5 changes: 5 additions & 0 deletions docs/components/neuvector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Neuvector
---

https://open-docs.neuvector.com
5 changes: 5 additions & 0 deletions docs/components/rancher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Rancher
---

https://ranchermanager.docs.rancher.com
3 changes: 3 additions & 0 deletions docs/components/sle-micro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: SLE Micro
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could link https://www.suse.com/products/micro/ or perhaps better https://documentation.suse.com/sle-micro here?

I've also been wondering if we should test with LeapMicro e.g https://github.com/suse-edge/metal3-demo currently uses Leap, so it would be a more logical move to switch that to LeapMicro for upstream/community usage, or we can just document how to get the SLEMicro image instead (which is probably OK but not ideal from a community perspective).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's chat about this once I'm back from PTO. It's an interesting thought but I'd like to make sure that Leap Micro and SLE Micro maintain the same ABI compatibility that SLES and Leap do.

12 changes: 12 additions & 0 deletions docs/concepts/terms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Terminology
sidebar_position: 1
---


There is a lot of terminology used in this space. Let's keep track of what means what.

- Kubernetes
- Container
agracey marked this conversation as resolved.
Show resolved Hide resolved
- Cluster API
agracey marked this conversation as resolved.
Show resolved Hide resolved
-
5 changes: 4 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
sidebar_label: Overview
sidebar_label: Start Here!
title: ''
---

# Overview

Welcome to the **SUSE Edge Engineering** docs.

:::warning
We suggest you to please put on your hard hat, as we are rapidly building out our documentation.
:::

270 changes: 270 additions & 0 deletions docs/integrations/create-package-obs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
---
sidebar_position: 10
title: Create a package (RPM or Container image) using OBS (openSUSE Build Service)
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

## openSUSE Build Service

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now this seems fine in the integrations section, but I wonder if we need a separate development section for this kind of content and other contributor guidelines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's chat about where to put contributor guides separately

The [openSUSE Build Service](https://build.opensuse.org) is the public instance of the [Open Build Service](https://openbuildservice.org/) used for development of the openSUSE distribution and to offer packages from same source for Fedora, Debian, Ubuntu, SUSE Linux Enterprise and other distributions..
agracey marked this conversation as resolved.
Show resolved Hide resolved

This service is also able to build container images, using either a `Dockerfile` or a KIWI configuration.

Everyone can create a SUSE IdP account to be able to use this service.

A published container image will be available on [registry.opensuse.org](https://registry.opensuse.org) and a published package would be available at [download.opensuse.org](https://download.opensuse.org)

## Prerequisites

In order to use OBS you first need an IdP account ([sign up here](https://idp-portal.suse.com/univention/self-service/#page=createaccount)) and you need to log into [build.opensuse.org](https://build.opensuse.org)

You will also need the `osc` (for openSUSE Commander) command as this quickstart will do it the CLI way, but most things can be done in the WebUI if you prefer.

To install `osc`:

<Tabs>
<TabItem value="suse" label="SUSE" default>

```bash
zypper install osc
```

</TabItem>
<TabItem value="mac" label="MacOS">

```bash
brew install osc
```

</TabItem>
<TabItem value="pip" label="PIP">

```bash
pip install osc
```

</TabItem>
</Tabs>

## Create and configure a project

We are going to create a project under your home namespace, this will bring up your editor to configure it right away.

```bash
osc meta prj -e "home:$USERNAME:$PROJECTNAME"
```

:::note

If you want to use your home project root just specify `home:$USERNAME` here and in following steps
agracey marked this conversation as resolved.
Show resolved Hide resolved

:::

In the editor you can now fill the metadata to look similar to this:

```xml
<project name="home:$USERNAME">
<title/>
<description/>
<person userid="$USERNAME" role="maintainer"/>
<!--
If you want to build RPM packages you need a block like this one, here for
SLE-15 SP4 replace accordingly to the distribution you want to target
agracey marked this conversation as resolved.
Show resolved Hide resolved
-->
<repository name="sp4">
<path project="SUSE:SLE-15-SP4:Update" repository="standard"/>
<path project="SUSE:SLE-15-SP4:GA" repository="standard"/>
<arch>x86_64</arch>
<arch>s390x</arch>
<arch>aarch64</arch>
</repository>
<!-- If you want to build container images you need a block akin to this one -->
<repository name="containers">
<!--
This defines the available source images for the build (here any from
registry.suse.com)
-->
<path project="SUSE:Registry" repository="standard"/>
<!--
These defines package repositories available during build, I am
agracey marked this conversation as resolved.
Show resolved Hide resolved
refering to the one above here so I can use the RPM packages published
in this project for the container images of the project
-->
<path project="home:$USERNAME:$PROJECTNAME" repository="sp4"/>
<!-- This is the list of architecture you want to build for -->
<arch>x86_64</arch>
<arch>s390x</arch>
<arch>aarch64</arch>
</repository>
</project>
```

If you want to build containers you need to tweak the configuration of the project as well:

```bash
osc meta prjconf -e "home:$USERNAME:$PROJECTNAME"
```

The configration is different whether you want to use KIWI or Dockerfile build system:
agracey marked this conversation as resolved.
Show resolved Hide resolved

<Tabs groupId="buildtype">
<TabItem value="docker" label="Dockerfile">

```
%if "%_repository" == "containers"
Type: docker
Repotype: none
Patterntype: none
BuildEngine: podman
%endif
```

</TabItem>
<TabItem value="kiwi" label="Kiwi">

```
%if "%_repository" == "containers"
Type: kiwi
Repotype: none
Patterntype: none
%endif
```

</TabItem>
</Tabs>

:::note

If you want to build containers using both KIWI and `Dockerfiles` in the same project, you need two repositories
in your project's metadata (with different names) and both snippets in project's configuration (one for each repository).

:::

## Create a package

To create a package in your project use the following command:

```bash
osc meta pkg -e home:$USERNAME:$PROJECTNAME $PACKAGENAME
```

There you'll get another XML file to edit, you only have to set a title and description here.

Now you can checkout the directory to start adding your files:

```bash
osc co home:$USERNAME:$PROJECTNAME/$PACKAGENAME
```

Now go into the directory and when all is ready you can add your files and commit using:

```bash
osc add <files>...
osc ci
```

Now let's see the specificities of RPM and Container packages

### RPM package

An RPM package is defined by the presence of a spec file, I will not go into the details of that file
agracey marked this conversation as resolved.
Show resolved Hide resolved
as this is way beyond the scope of that quickstart, please refer to https://en.opensuse.org/Portal:Packaging for more
details about packaging.

I will however get into more details about the `_service` and `_constraints` special files that may change the
behavior of OBS.

The `_service` file allows one to define automation to happen on said time, for RPM packages these are usually manually triggered.
It is then possible to automate fetching a git repository into a tarball, updating the specfile version from git info, vendoring
go or rust dependencies, etc...You can get more insight into what is possible here
https://en.opensuse.org/openSUSE:Build_Service_Concept_SourceService .

Here is one for a rust project for example:

```xml title="_services"
<services>
<service name="tar_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://github.com/project-akri/akri</param>
<param name="filename">akri</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="revision">v0.10.4</param>
</service>
<service name="recompress" mode="manual">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="manual" />
<service name="cargo_vendor" mode="manual">
<param name="srcdir">akri</param>
<param name="compression">xz</param>
</service>
</services>
```

The `_constraints` file allow to define "restrictions" about the builder selected by OBS, like for example the disk size, if your build
complains about having not enough space, this is the file you should edit/create.
See here for the complete guide: https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.build_job_constraints.html

### Container image

You can build a container image in two different ways, you can either use a `Dockerfile` or a KIWI configuration.

Each method has their own benefits and drawbacks.
Kiwi supports using the package manager from the host/build system, so it can build base images and derive images which don't contain a package manager,
like `opensuse/busybox`. With Dockerfile, it's practically required to use a full base image like `opensuse/tumbleweed`.

I won't go into details how a Dockerfile or a kiwi build works, I'll just tell about the interaction with OBS.

First the `kiwi_metainfo_helper` service that you can add as a buildtime source service allows to substitute buildtime placeholders to use in you Dockerfile
or kiwi configuration. You can find a list of the placeholders here: https://build.opensuse.org/package/view_file/openSUSE:Factory/obs-service-kiwi_metainfo_helper/README

Another useful service is the `replace_using_package_version` service, that allows to replace a placeholder with the version of a RPM package.
For example if I have `foobar` package in version `1.2.3` in an available RPM repository, I can use this service to automatically tag an image that has this
package installed. Here it would replace `%PKG_VERSION%` to `1.2`.

```xml title="_services"
<services>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service mode="buildtime" name="replace_using_package_version">
<param name="file">Dockerfile</param>
<param name="regex">%PKG_VERSION%</param>
<param name="parse-version">minor</param>
<param name="package">foobar</param>
</service>
</services>
```

You now have to tell OBS about the name and tag of your image:

<Tabs groupId="buildtype">
<TabItem value="docker" label="Dockerfile">

You can use one or multiple `BuildTag` as comments in your `Dockerfile`
like this:

```
#!BuildTag: foo/bar:latest foo/bar:%PKG_VERSION%.%RELEASE%
#!BuildTag: foo/bar:tag foo/bar:anothertag
```

</TabItem>
<TabItem value="kiwi" label="Kiwi">

In the kiwi configuration to specify the tags of your image you use the `containerconfig` element, like this:

```xml
<preferences>
<type image="docker">
<containerconfig
name="foo/bar"
tag="latest"
additionaltags="atag,anothertag,%PKG_VERSION%.%RELEASE">
...
```

</TabItem>
</Tabs>
4 changes: 4 additions & 0 deletions docs/integrations/linkerd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
sidebar_position: 7
title: Using the Linkerd Service Mesh
---
2 changes: 1 addition & 1 deletion docs/quickstart/nats.md → docs/integrations/nats.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_position: 6
agracey marked this conversation as resolved.
Show resolved Hide resolved
title: NATS on K3s
title: Setting up NATS on K3s
---

# Intro
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_position: 8
title: NVIDIA GPU's on SLE Micro
sidebar_position: 1
title: Using NVIDIA GPU's on SLE Micro
---

# Intro
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading