Skip to content

Commit 987689d

Browse files
committed
Update deps and airap doc
1 parent b189add commit 987689d

4 files changed

Lines changed: 86 additions & 43 deletions

File tree

action-wrappers

Submodule action-wrappers updated from 7b32adb to 05c9f47

common-helm-charts

Submodule common-helm-charts updated from 8bbd918 to 2387c96

docs/docs/howto/install_ryax_kubernetes_airgap.md

Lines changed: 83 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ cd ryax-engine && git submodule update --init
4141

4242
This script creates two file, one containing the images necessary to run ryax, and the helm package required for the installation. Additionnaly, you need to copy the two following file for your aigap installation:
4343

44-
- [ryax-airgap -helm-values](https://raw.githubusercontent.com/RyaxTech/ryax-engine/refs/heads/master/airgap/ryax-airgap-helm-values.yaml)
44+
- [ryax-airgap-helm-values](https://raw.githubusercontent.com/RyaxTech/ryax-engine/refs/heads/master/airgap/ryax-airgap-helm-values.yaml)
4545
- [minimal.yaml](https://raw.githubusercontent.com/RyaxTech/ryax-engine/refs/heads/master/chart/env/minimal.yaml)
4646

4747
### Generate the list of dependencies for the builder
4848

49-
For this step, you need a machine with the same architecture of the targeted cluster, and the package manager nix installed.
49+
For this step, you need a machine **with the same architecture of the targeted cluster**, and the package manager nix installed.
5050

5151
First you need to clone the repository [ryax-wrappers](https://gitlab.com/ryax-tech/ryax/ryax-action-wrappers).
5252
For airgapped environment, you can pre-build and package all build dependencies with:
@@ -80,64 +80,108 @@ helm install ryax ./ryax-engine-*.tgz -n ryaxns --create-namespace -f ./minimal.
8080

8181
Ryax gets Action definitions from Git repositories. To inject Ryax default actions you can **use a locally accessible Git server** where you can clone https://gitlab.com/ryax-tech/workflows/default-actions.git
8282

83-
> Other Ryax actions that might interest you depending on your use case are available in https://gitlab.com/ryax-tech/workflows
84-
{.is-info}
83+
!!! info
84+
Other Ryax actions that might interest you depending on your use case are available in https://gitlab.com/ryax-tech/workflows
8585

86-
If you don't have a git server accessible withing the airgap installation, you can directly copy the repository into the ryax-repository pod with `kubectl cp`.
86+
**If you have a git server accessible withing the airgap installation, you can directly go to following section.**
87+
88+
If you don't have a git server, you can directly copy the repository into the ryax-repository pod with `kubectl cp`.
8789

8890
```bash
8991
# Find the name of the ryax-repository pod
90-
$ kubectl -n ryaxns get pod | grep repository
91-
ryax-repository-97c5554db-jzhdp
92-
93-
# Create an archive for the repogit (assuming the repo containing the actions is names default-actions)
94-
tar cvf default-actions.tar default-actions
92+
REPOSITORY_POD=$(kubectl -n ryaxns get pod -l ryax.tech/resource-name=repository -o jsonpath='{.items[0].metadata.name}')
9593

9694
# Inject the action repository into /tmp
97-
kubectl cp default-actions.tar -n ryaxns ryax-repository-97c5554db-jzhdp:/tmp/
95+
kubectl cp default-actions -n ryaxns ${REPOSITORY_POD}:/tmp/
9896

99-
# Use kubectl exec to untar the copied repository inside the pod
97+
# Use kubectl exec to check the content of the copied repository inside the pod
98+
kubectl exec -ti -n ryaxns ${REPOSITORY_POD} -- ls /tmp/default-actions
10099
```
101100

102-
<!--
103-
I (adfaure) tested without success:
101+
Now in the web UI Library, create a new repository with this URL: `file:///tmp/default-action`. You can run a scan and see the available actions.
102+
103+
### Build Actions
104+
105+
In order to build Ryax actions, the Ryax Action Builder requires an access to software packages inside you airgapped environment.
106+
Depending on the action type you use you need to configure package servers and/or import packages in the Builder
107+
108+
You can configure the build using environement variables in the Builder: All variables prefixed by `RYAX_BUILD_ENV_` are exposed during the build phase.
109+
110+
!!! warning
111+
The support of action build in airgapped is in **TECHNOLOGICAL PREVIEW**.
112+
Only the `python3` action type is supported for now.
113+
You can follow the futur developement here: https://gitlab.com/groups/ryax-tech/ryax/-/epics/33
114+
115+
116+
#### Python packages
117+
118+
To support python packages, the builder need to access to a Pypi compatible server.
119+
If don't have one in your environment, here is examples of tools that you can install :
120+
121+
- [pypiserver](https://github.com/pypiserver/pypiserver) minimal pypi server
122+
- [Morgan](https://github.com/ido50/morgan) open source offline repo
123+
- [Nexus](https://www.sonatype.com/products/sonatype-nexus-repository) a popular proprietary tool to host packages
104124

105-
**Only if you do not have a local Git server** you can inject the actions repository directly into the Ryax Repository service. For example, you import the default action git repository in your `/home/example/myrepos` on the hosting node of your Ryax installation and expose it with a `hostPath` in the `ryax-repository` service using these options in the helm values:
125+
To use your internal Pypi server, you need to configure the following env variable in the Ryax action builder.
126+
In the Helm chart add the extra env in the `action-builder` section (Change with your server host name):
106127
```yaml
107-
repository:
108-
extraVolumes:
109-
- name: repos
110-
hostPath:
111-
path: /home/example/myrepos
112-
type: DirectoryOrCreate
113-
extraVolumeMounts:
114-
- mountPath: /data/repos
115-
name: repos
128+
action-builder:
129+
extraEnv:
130+
- name: RYAX_BUILD_ENV_UV_INDEX_URL
131+
value: http://mypipy-server.example.com
132+
- name: RYAX_BUILD_ENV_UV_TRUSTED_HOST
133+
value: mypipy-server.example.com
134+
- name: RYAX_EXTRA_NIX_ARGS
135+
value: --no-net
116136
```
117-
-->
118137
119-
Now in the web UI Library, create a new repository with this URL: `file:///tmp/default-action`. You can run a scan and see the available actions.
138+
### Nix packages
120139
121-
### Build Actions
140+
To have access to Nix packages inside you airgapped environment you can either use an internal package binary cache or import packages directly in the Builder
122141
123-
In order to build Ryax actions, the Ryax Action Builder requires an access to external mirror for Python packages and Nix packages.
142+
#### Using a binary cache:
124143
125-
Pypi mirror:
144+
Install a Nix Binary cache, for example:
126145
127-
- [Morgan](https://github.com/ido50/morgan) open source offline
128-
- [Nexus](https://www.sonatype.com/products/sonatype-nexus-repository) a popular proprietary tool to host packages
129-
Nixpkgs mirror:
130146
- [nix serve](https://github.com/edolstra/nix-serve) a basic nix binary cache server
131-
- [Attic](https://github.com/zhaofengli/attic) more advanced
147+
- [Attic](https://github.com/zhaofengli/attic) more advanced with access rights and storage optimisation
148+
149+
Then configure the Builder to use it as a substituer (Change with server host name):
150+
```yaml
151+
action-builder:
152+
extraEnv:
153+
- name: RYAX_EXTRA_NIX_ARGS
154+
value: --option substituters my-nix-cache.example.com
155+
```
156+
157+
Now you need to inject, in you cache the bundle created at the end of the configuration step: `ryax-build-deps.nixexport`
132158

159+
#### Inject packages in the Builder
133160

134-
#### Nix Build dependencies bundle
161+
!!! info
162+
If you have Nix binary cache you can directly import the packages created in the configuration step, and skip the following
163+
164+
If you don't have a server, you can directly import packages into the Ryax Action Builder Nix store with `kubectl cp`.
135165

136166
Transfert the bundle into the airgapped environment, and inject the bundle into the action builder local store with:
137-
```shell
138-
nix-store --import < ryax-build-deps.nixexport
167+
```bash
168+
# Find the name of the pod
169+
BUILDER_POD=$(kubectl -n ryaxns get pod -l ryax.tech/resource-name=action-builder -o jsonpath='{.items[0].metadata.name}')
170+
171+
# Inject the nix bundle into the builder
172+
kubectl exec -ti -n ryaxns ${BUILDER_POD} -- nix-store --import < ryax-build-deps.nixexport
139173
```
140174

175+
!!! tip
176+
If you need extra packages for actions that define `spec.dependencies` in the `ryax_metadata.yaml` create a bundle and import it using the same process:
177+
```bash
178+
# build something and get a ./result link
179+
# then export it with its dependencies
180+
nix-store --export $(nix-store --query --requisites ./result) > action-deps.nixexport
181+
# copy it into the builder and run
182+
nix-store --import < action-deps.nixexport
183+
```
184+
141185
## Offline Updates
142186

143187
!!! warning
@@ -148,14 +192,13 @@ To trigger an update of Ryax in n offline environment, you can reuse the instal
148192
sudo k3s ctr images import ./ryax-airgap-images-amd64.tar.gz
149193
helm upgrade --install ryax ./ryax-engine-*.tgz -n ryaxns --reuse-values
150194
```
195+
Don't forget to update Nix build dependencies with the process defined in the configuration.
151196

152-
### With a private registry
197+
<!-- ### With a private registry
153198

154199
You'll also need to have a private registry that can host both container images and Helm charts.
155200
Example tools:
156-
157201
- [Hauler](https://github.com/hauler-dev/hauler)
158202
- [Harbor](https://goharbor.io/)
159-
160-
TODO: explain how to overrride image repo with k3s mirror or helm chart override
203+
TODO: explain how to overrride image repo with k3s mirror or helm chart override -->
161204

runner

Submodule runner updated from b5327fb to b2c0b7f

0 commit comments

Comments
 (0)