Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
47 changes: 31 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
PROJECT_NAME: exordos-base
PROJECT_NAME_MINIMAL: exordos-base-minimal
REPO_ENDPOINT_PUT: http://10.20.0.1:8082

jobs:
Expand All @@ -25,7 +26,7 @@ jobs:
set -eux

# Build in all image formats
export GEN_IMG_FORMAT=qcow2,zst,raw
export GEN_IMG_FORMAT=qcow2,zst

exordos build $(pwd)

Expand All @@ -34,29 +35,43 @@ jobs:

# Upload the VM images
cd output
curl -X PUT --upload-file exordos-base.qcow2 \
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/${VERSION}/exordos-base.qcow2
curl -X PUT --upload-file exordos-base.raw.zst \
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/${VERSION}/exordos-base.raw.zst
curl -X PUT --upload-file exordos-base.raw \
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/${VERSION}/exordos-base.raw

upload_image() {
local file=$1
local project=${2:-$PROJECT_NAME}
curl -X PUT --upload-file "$file" \
"${REPO_ENDPOINT_PUT}/${project}/${VERSION}/$file"
}

upload_image exordos-base.qcow2
upload_image exordos-base.raw.zst
upload_image exordos-base-minimal.qcow2 $PROJECT_NAME_MINIMAL
upload_image exordos-base-minimal.raw.zst $PROJECT_NAME_MINIMAL

sha256sum exordos-base.qcow2 >> SHA256SUMS
sha256sum exordos-base.raw.zst >> SHA256SUMS
sha256sum exordos-base.raw >> SHA256SUMS
sha256sum exordos-base-minimal.qcow2 >> SHA256SUMS
sha256sum exordos-base-minimal.raw.zst >> SHA256SUMS

curl -X PUT --upload-file SHA256SUMS \
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/${VERSION}/SHA256SUMS
curl -X PUT --upload-file SHA256SUMS \
${REPO_ENDPOINT_PUT}/${PROJECT_NAME_MINIMAL}/${VERSION}/SHA256SUMS

if [[ $GITHUB_REF == refs/tags/* ]]; then
curl -X PUT --upload-file exordos-base.qcow2 \
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/latest/exordos-base.qcow2
curl -X PUT --upload-file exordos-base.raw.zst \
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/latest/exordos-base.raw.zst
curl -X PUT --upload-file exordos-base.raw \
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/latest/exordos-base.raw
curl -X PUT --upload-file SHA256SUMS \
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/latest/SHA256SUMS
upload_latest() {
local file=$1
local project=${2:-$PROJECT_NAME}
curl -X PUT --upload-file "$file" \
"${REPO_ENDPOINT_PUT}/${project}/latest/$file"
}

upload_latest exordos-base.qcow2
upload_latest exordos-base.raw.zst
upload_latest exordos-base-minimal.qcow2 $PROJECT_NAME_MINIMAL
upload_latest exordos-base-minimal.raw.zst $PROJECT_NAME_MINIMAL
upload_latest SHA256SUMS
upload_latest SHA256SUMS $PROJECT_NAME_MINIMAL
fi


Expand Down
71 changes: 56 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# Exordos Core Base Image

This is a base image for Exordos Core project. The image contains all necessary tools and libraries to be used in Exordos installations.
This repository builds two base images for Exordos Core project. The images contain all necessary tools and libraries to be used in Exordos installations.

## Images

- **exordos-base** - Full-featured base image using Ubuntu 26 profile with 4.5GB disk size
- **exordos-base-minimal** - Minimal base image using Ubuntu 26 minimal profile with 3.8GB disk size

The key features are:

- [Universal Agent](https://github.com/infraguys/gcl_sdk/wiki/universal_agent) service.
- Exordos root autoresize service. Tries to perform resize of the root partition at every boot if it's possible.
- Exordos bootstrap service. Runs the bootstrap scripts.

# 🛠️ Build
## 🛠️ Build

You need [DevTools](https://github.com/exordos/exordos) to build the image. Look at the [install](https://github.com/exordos/exordos/blob/master/README.md#install) section for details.


Run the build command:

```bash
Expand All @@ -21,40 +25,77 @@ exordos build -i ~/.ssh/key.pub -f .

Where `~/.ssh/key.pub` is your public key for the image.

Also you may set the `GEN_USER_PASSWD` environment variable to change the default user password.
This command builds both images: `exordos-base` and `exordos-base-minimal`.

### Environment Variables

You can customize the build using the following environment variables:

- `GEN_USER_PASSWD` - Set the default user password (default: "ubuntu")
- `GEN_SDK_VERSION` - Specify the SDK version to install (default: "3.0.5")
- `LOCAL_GENESIS_SDK_PATH` - Path to local SDK copy for development purposes

Examples:

```bash
# Set custom user password
export GEN_USER_PASSWD=secret
exordos build -i ~/.ssh/key.pub -f .
```

To build with local copy of the SDK, export the `LOCAL_GENESIS_SDK_PATH` environment variable:
# Use specific SDK version
export GEN_SDK_VERSION=3.0.5
exordos build -i ~/.ssh/key.pub -f .

```bash
# Build with local copy of the SDK
export LOCAL_GENESIS_SDK_PATH=/path/to/gcl_sdk
exordos build -i ~/.ssh/key.pub -f .
```
```

# 🚀 Usage
## 🚀 Usage

Upload the image to your repository. Using API, CLI or web interface create a node with the image.

### Using exordos-base

```bash
curl --location 'http://10.20.0.2:11010/v1/nodes/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ****' \
--data '{

"name": "vm",
"project_id": "f1f14cf1-1639-40dc-b725-757506a202b4",
"root_disk_size": 15,
"cores": 1,
"ram": 1024,

"image": "http://10.20.0.1:8080/exordos-base.raw"
}'
"disk_spec": {
"kind": "root_disk",
"size": 15,
"image": "http://10.20.0.1:8080/exordos-base/exordos-base.qcow2"
}
}
```

### Using exordos-base-minimal

```bash
curl --location 'http://10.20.0.2:11010/v1/nodes/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ****' \
--data '{

"name": "vm",
"project_id": "f1f14cf1-1639-40dc-b725-757506a202b4",
"cores": 1,
"ram": 1024,
"disk_spec": {
"kind": "root_disk",
"size": 15,
"image": "http://10.20.0.1:8080/exordos-base.qcow2"
}
}
```

# 📃 Bootstrap scripts
## 📃 Bootstrap scripts

For next images in hierarchy you can add scripts that are executed at the very first boot of the node. Actually it can be any executable file and not only bash scripts. Put your scripts in the `/var/lib/exordos/bootstrap/scripts` directory and they will be executed in the order of the files in the directory.
For next images in hierarchy you can add scripts that are executed at the very first boot of the node. Actually it can be any executable file and not only bash scripts. Put your scripts in the `/var/lib/exordos/bootstrap/scripts` directory and they will be executed in the order of the files in the directory.
16 changes: 16 additions & 0 deletions exordos/exordos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,19 @@ build:
# Override image build parameters, for instance Packer parameters
override:
disk_size: "4500M"
- name: exordos-base-minimal
format: GEN_IMG_FORMAT=qcow2
envs:
- GEN_USER_PASSWD
- GEN_SDK_VERSION=3.0.5

# OS profile for the image
profile: ubuntu_26_minimal

# Provisioning script
script: images/exordos_base/install.sh

# Override image build parameters, for instance Packer parameters
override:
disk_size: "3800M"

2 changes: 1 addition & 1 deletion exordos/images/exordos_base/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sudo sed -i 's/^preserve_hostname: false/preserve_hostname: false\napt_preserve_
sudo apt update
sudo apt dist-upgrade -y
sudo apt install -y build-essential python3-dev python3-venv \
cloud-guest-utils irqbalance qemu-guest-agent libev-dev rsync parted j2cli
cloud-guest-utils irqbalance qemu-guest-agent libev-dev rsync parted j2cli vim
Comment thread
akremenetsky marked this conversation as resolved.

export UV_INSTALL_DIR="/usr/local/bin"
curl --fail --show-error --location --progress-bar https://repo.exordos.com/uv/0.11.11/uv --output "${UV_INSTALL_DIR}/uv"
Expand Down