Skip to content

Commit 50f16cf

Browse files
committed
Merge branch 'unstable' into stable
2 parents 8a5d26c + ad06274 commit 50f16cf

File tree

19 files changed

+257
-198
lines changed

19 files changed

+257
-198
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ All notable changes to this project will be documented in this file.
77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

10+
## [1.4.0-beta-5] - 2025-02-17
11+
12+
### Changed
13+
14+
- Made Deployer ignore some types of Actions inside containers.
15+
16+
### Fixed
17+
18+
- `executor` field optionality, empty regexes in `Test` Action, output composing.
19+
1020
## [1.4.0-beta-4] - 2025-02-16
1121

1222
### Added
@@ -437,6 +447,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
437447
- Build support.
438448
- TUI.
439449

450+
[1.4.0-beta-5]: https://github.com/impulse-sw/deployer/compare/1.4.0-beta-5...1.4.0-beta-5
440451
[1.4.0-beta-4]: https://github.com/impulse-sw/deployer/compare/1.4.0-beta-3...1.4.0-beta-4
441452
[1.4.0-beta-3]: https://github.com/impulse-sw/deployer/compare/1.4.0-beta-2...1.4.0-beta-3
442453
[1.4.0-beta-2]: https://github.com/impulse-sw/deployer/compare/1.4.0-beta-1...1.4.0-beta-2

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "deployer"
3-
version = "1.4.0-beta-4"
3+
version = "1.4.0-beta-5"
44
edition = "2024"
55

66
[dependencies]

DOCS.en.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,22 @@ In addition, if your Pipelines need to manage conflicting cache versions (for ex
694694

695695
#### 2.1. Containerized assembly and execution, as well as strategies
696696

697-
The deployment supports the build and execution of projects in containerized environments with the ability to extract artifacts to the project folder. This can be useful in cases where you need to build a project for other platforms and/or environments.
697+
Since Deployer can execute any commands, it can also automate deployment in containers and clusters using Docker and Kubernetes-like platforms. But most interestingly, Deployer provides automation for building and running your Pipelines in Docker and Podman containers with automatic `Dockerfile` generation. Artifacts will also be automatically extracted and placed in the project folder. Containerized building can be useful in cases where building for other platforms or in a different environment is required.
698698

699-
In addition, the Deployer allows you to specify basic images, a list of commands for installing dependencies and configuring the image, as well as strategies for saving caches. Collectively, this allows you to generate information for `Dockerfile` images automatically.
699+
In this regard, Deployer allows additional functions (see below).
700+
701+
Building and execution occur as follows:
702+
703+
1. An image is formed to build Deployer for the desired platform (for executing Pipelines based on the image).
704+
2. Deployer is built.
705+
3. An image is formed to build the project for the desired platform - with necessary dependencies and other commands that can be specified independently.
706+
4. If build caching strategies are specified, Deployer performs the build and saves caches.
707+
5. Deployer on the host machine runs Deployer in the container and performs complete Pipeline execution.
700708

701709
> [!NOTE]
702-
> Deployer versions 1.4.0-beta-1/1.4.0-beta-2 only support Pipeline launch in Docker containerized environments.
710+
> When building in containers, Deployer does not support Actions `interrupt`, `observe`, `add_to_storage` and `use_from_storage`, and when running - Actions `add_to_storage` and `use_from_storage`.
711+
>
712+
> To solve problems of synchronizing files or performing I/O operations, you can use a Pipeline with containerized build options inside another Pipeline, which can then use the Actions you need.
703713
704714
Let's look at an example of a containerized Pipeline:
705715

@@ -794,23 +804,22 @@ Let's look at an example of a containerized Pipeline:
794804
"COPY rust-toolchain.toml .",
795805
"COPY .docker-fake-files/rust/lib.rs src/lib.rs",
796806
"COPY .docker-fake-files/rust/main.rs src/main.rs",
797-
"COPY Cargo.toml .",
798-
"COPY deploy-config.json ."
807+
"COPY Cargo.toml ."
799808
],
800809
"pre_cache_cmds": [
801-
"RUN /app/deployer run containered --current --containered --no-pipe"
810+
"DEPL"
802811
]
803812
},
804813
{
805814
"copy_cmds": [
806-
"COPY src/ src/"
815+
"COPY src/ src/",
816+
"COPY DOCS.en.md .",
817+
"COPY DOCS.ru.md ."
807818
],
808819
"pre_cache_cmds": [
809-
"COPY DOCS.en.md .",
810-
"COPY DOCS.ru.md .",
811820
"RUN touch src/main.rs",
812821
"RUN touch src/lib.rs",
813-
"RUN /app/deployer run containered --current --containered --no-pipe"
822+
"DEPL"
814823
]
815824
}
816825
]
@@ -819,34 +828,29 @@ Let's look at an example of a containerized Pipeline:
819828
}
820829
```
821830

822-
The only difference is the addition of the `containered_opts` field, which automatically forces the Deployer to execute this Pipeline in a containerized environment.
831+
The only difference is adding the `containered_opts` field, which automatically makes Deployer execute this Pipeline in a containerized environment.
823832

824833
- `base_image` - you can specify the base image for building the project (default is `ubuntu:latest`)
825-
- `preflight_cmds` - a list of commands for installing the environment correctly
826-
- `build_deployer_base_image`, `preflight_deployer_build_deps` and `deployer_build_cmds` - base image, configuration commands and commands for building the Deployer itself
827-
- `cache_strategies` - caching strategies during build stage
834+
- `preflight_cmds` - list of commands for proper environment setup
835+
- `build_deployer_base_image`, `preflight_deployer_build_deps` and `deployer_build_cmds` - base image, setup commands, and commands for building Deployer itself
836+
- `cache_strategies` - caching strategies during build
837+
- `use_containerd_local_storage_cache` - when building in Docker with enabled `containerd` feature in `/etc/docker/daemon.json`, allows saving image cache in the Pipeline execution folder, which simplifies cache cleanup
838+
- `prevent_metadata_loading` - prevents reconnecting to registries and searching for a new image when an old one is available (allows building and running Pipelines in containers without Internet access)
839+
- `executor` - allows specifying the build and run executor (default is Docker, specify `podman` to use Podman)
828840

829-
Since the Deployer is needed in a containerized environment, check the compatibility of the Deployer and the environment by launching the Pipeline. If the Deployer is built with Python support, it is best to use identical base images.
841+
Since Deployer is needed in a containerized environment, check Deployer and environment compatibility by running the Pipeline. If Deployer is built with Python support, it's best to use identical base images.
830842

831-
To keep the build cache, rather than constantly rebuilding the Pipeline from scratch, it is recommended to specify caching strategies. They are executed when building a containerized environment. Available fields:
843+
To preserve build caches rather than constantly rebuilding the Pipeline from scratch, it's recommended to specify caching strategies. They are executed when building the containerized environment. Available fields:
832844

833-
- `fake_content` - a field for syncing content to replace existing files (works the same way as `use_from_storage`, but does not support `latest` tags)
834-
- `copy_cmds` - commands for copying source code to an image
835-
- `pre_cache_cmds` - commands for pre-caching
845+
- `fake_content` - field for content synchronization to substitute existing files (works like `use_from_storage` but doesn't support `latest` tags)
846+
- `copy_cmds` - commands for copying source code into the image
847+
- `pre_cache_cmds` - commands for preliminary caching
836848

837-
Caching strategies are suitable for implementing multi-stage builds. In the above example, there is a two-stage build for a Rust project, which first requires copying the real `Cargo.toml` and fake `lib.rs `and `main.rs `to compile all the dependencies of the project first, and then copies the real source code `src/` and updates the timestamps `RUN touch src/main.rs & touch src/lib.rs` to then build the project without having to rebuild dependencies. In this case, the dependency cache will be used until `Cargo.toml` is edited.
849+
If you need to execute a Pipeline as a preliminary caching command, specify the `"DEPL"` command. The containerized Pipeline configuration will be added to the container automatically.
838850

839-
To rebuild containered environment from scratch, run Deployer with flag `-f`/`--fresh`.
851+
Caching strategies are suitable for implementing multi-stage builds. In the example above, a two-stage build for a Rust project occurs, which first requires copying the real `Cargo.toml` and fake `lib.rs` and `main.rs` to first compile all project dependencies, and then copies the real source code `src/` and updates timestamps `RUN touch src/main.rs & touch src/lib.rs` to then build the project without needing to rebuild dependencies. In this case, the dependencies cache will be used until `Cargo.toml` is edited.
840852

841-
Additionally Deployer supports caching for images and their metadata (to avoid repeated requests to the server when the image is already present in the system) and caching files in local storage (in the pipeline folder) (to do this, it is necessary to activate the `containerd` feature in the file `/etc/docker/daemon.json`):
842-
843-
```json
844-
"containered_opts": {
845-
...,
846-
"use_containerd_local_storage_cache": true,
847-
"prevent_metadata_loading": true
848-
}
849-
```
853+
To rebuild the environment from scratch, run Deployer with the `-f`/`--fresh` flag.
850854

851855
### <a id="other-entities">3. Other entities</a>
852856

DOCS.ru.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,7 @@ deployer new content
487487
"show_bash_c": false,
488488
"only_when_fresh": false
489489
},
490-
"success_when_found": "some rust regex",
491-
"success_when_not_found": null
490+
"success_when_found": "some rust regex"
492491
}
493492
```
494493

@@ -695,12 +694,22 @@ deployer new content
695694

696695
#### 2.1. Контейнеризированная сборка и выполнение, а также стратегии
697696

698-
Деплойер поддерживает сборку и выполнение проектов в контейнеризированных окружениях с возможностью извлечения артефактов в папку проекта. Это может быть удобным в тех случаях, когда требуется сборка проекта под другие платформы и/или окружения.
697+
Поскольку Деплойер может выполнять любые команды, он также может автоматизировать выполнение развёртывания в контейнерах и кластерах при помощи Docker- и Kubernetes-подобных платформ. Но, что самое интересное, Деплойер предоставляет автоматизацию сборки и запуска ваших Пайплайнов в контейнерах Docker и Podman с автоматической генерацией `Dockerfile`. Артефакты также будут извлечены автоматически и помещены в папку проекта. Контейнеризированная сборка может быть полезной в тех случаях, когда требуется сборка под другие платформы или в другом окружении.
699698

700-
Помимо этого, Деплойер позволяет указывать базовые образы, список команд для установки зависимостей и настройки образа, а также стратегии для сохранения кэшей. Совокупно это позволяет генерировать информацию для образов `Dockerfile` автоматически.
699+
В этом плане Деплойер позволяет дополнительные функции (см. ниже).
700+
701+
Сборка и выполнение происходят следующим образом:
702+
703+
1. Формируется образ для сборки Деплойера под нужную платформу (для выполнения Пайплайнов на базе образа).
704+
2. Собирается Деплойер.
705+
3. Формируется образ для сборки проекта под нужную платформу - с необходимыми зависимостями и прочими командами, которые можно указать самостоятельно.
706+
4. Если указаны стратегии кэширования сборки, Деплойер производит сборку и сохраняет кэши.
707+
5. Деплойер на машине-хосте запускает Деплойер в контейнере и производит полное выполнение Пайплайна.
701708

702709
> [!NOTE]
703-
> В версиях Деплойера 1.4.0-beta-1/1.4.0-beta-2 есть поддержка только запуск Пайплайнов в контейнеризированных окружениях Docker.
710+
> При сборке в контейнерах Деплойер не поддерживает Действия `interrupt`, `observe`, `add_to_storage` и `use_from_storage`, а при запуске - Действия `add_to_storage` и `use_from_storage`.
711+
>
712+
> Для решения проблем синхронизации каких-то файлов или выполнения операций ввода-вывода вы можете использовать Пайплайн с опциями контейнеризированной сборки внутри другого Пайплайна, который уже сможет использовать нужные вам Действия.
704713
705714
Посмотрим на пример контейнеризированного Пайплайна:
706715

@@ -796,22 +805,21 @@ deployer new content
796805
"COPY .docker-fake-files/rust/lib.rs src/lib.rs",
797806
"COPY .docker-fake-files/rust/main.rs src/main.rs",
798807
"COPY Cargo.toml .",
799-
"COPY deploy-config.json ."
800808
],
801809
"pre_cache_cmds": [
802-
"RUN /app/deployer run containered --current --containered --no-pipe"
810+
"DEPL"
803811
]
804812
},
805813
{
806814
"copy_cmds": [
807-
"COPY src/ src/"
815+
"COPY src/ src/",
816+
"COPY DOCS.en.md .",
817+
"COPY DOCS.ru.md ."
808818
],
809819
"pre_cache_cmds": [
810-
"COPY DOCS.en.md .",
811-
"COPY DOCS.ru.md .",
812820
"RUN touch src/main.rs",
813821
"RUN touch src/lib.rs",
814-
"RUN /app/deployer run containered --current --containered --no-pipe"
822+
"DEPL"
815823
]
816824
}
817825
]
@@ -826,6 +834,9 @@ deployer new content
826834
- `preflight_cmds` - список команд для правильной установки окружения
827835
- `build_deployer_base_image`, `preflight_deployer_build_deps` и `deployer_build_cmds` - базовый образ, команды для настройки и команды для сборки самого Деплойера
828836
- `cache_strategies` - стратегии кэширования при сборке
837+
- `use_containerd_local_storage_cache` - при сборке в Docker и включенной фиче `containerd` в `/etc/docker/daemon.json` позволяет сохранять кэш образов в папке выполнения Пайплайна, что упрощает очистку кэша
838+
- `prevent_metadata_loading` - предотвращает повторное подключение к регистрам и поиск нового образа, когда доступен старый (позволяет осуществлять сборку и запуск Пайплайнов в контейнерах без доступа к Интернету)
839+
- `executor` - позволяет указать исполнителя сборки и запуска (по умолчанию - Docker, для использования Podman укажите `podman`)
829840

830841
Поскольку Деплойер нужен в контейнеризированном окружении, проверяйте совместимость Деплойера и окружения путём запуска Пайплайна. Если Деплойер собран с поддержкой Python, лучше всего использовать идентичные базовые образы.
831842

@@ -835,20 +846,12 @@ deployer new content
835846
- `copy_cmds` - команды для копирования исходного кода в образ
836847
- `pre_cache_cmds` - команды для предварительного кэширования
837848

849+
Если в качестве команды предварительного кэширования нужно выполнить Пайплайн, укажите команду `"DEPL"`. Конфигурация контейнеризированного Пайплайна будет добавлена в контейнер автоматически.
850+
838851
Стратегии кэширования подходят для реализации многостадийных сборок. В указанном выше примере происходит двухстадийная сборка для Rust-проекта, которая сначала требует копирования реального `Cargo.toml` и фейковых `lib.rs` и `main.rs`, чтобы сначала скомпилировать все зависимости проекта, а потом уже копирует реальный исходный код `src/` и обновляет штампы времени `RUN touch src/main.rs & touch src/lib.rs`, чтобы затем собрать проект без необходимости пересборки зависимостей. В этом случае будет использоваться кэш зависимостей до тех пор, пока `Cargo.toml` не будет отредактирован.
839852

840853
Для пересборки окружения с нуля запустите Деплойер с флагом `-f`/`--fresh`.
841854

842-
Деплойер дополнительно поддерживает опцию кэширования для образов и их метаданных (чтобы избежать повторного обращения к серверу, когда образ уже имеется в системе) и опцию кэширования файлов в локальном хранилище (в папке пайплайна) (для этого необходимо активировать `containerd`-фичу в файле `/etc/docker/daemon.json`):
843-
844-
```json
845-
"containered_opts": {
846-
...,
847-
"use_containerd_local_storage_cache": true,
848-
"prevent_metadata_loading": true
849-
}
850-
```
851-
852855
### <a id="other-entities">3. Другие сущности</a>
853856

854857
Одной из самых важных сущностей являются переменные. Они одновременно являются и хранителями ваших секретов, и теми самыми динамическими сущностями, которые могут поменять исход выполнения Пайплайна. Пример простой переменной:

MIGRATIONS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Migrations guide
22

3+
> Actual configs' version: `4`.
4+
35
## From `1.4.0-beta-3` to `1.4.0-beta-4`
46

57
1. Manually check all your configuration files for programming languages and targets' OSes. Replace `null` values with strings in the lower register (for example, `"rust"`, `"linux"`, etc.).

0 commit comments

Comments
 (0)