You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DOCS.en.md
+34-30Lines changed: 34 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -694,12 +694,22 @@ In addition, if your Pipelines need to manage conflicting cache versions (for ex
694
694
695
695
#### 2.1. Containerized assembly and execution, as well as strategies
696
696
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.
698
698
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.
700
708
701
709
> [!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.
703
713
704
714
Let's look at an example of a containerized Pipeline:
705
715
@@ -794,23 +804,22 @@ Let's look at an example of a containerized Pipeline:
"RUN /app/deployer run containered --current --containered --no-pipe"
810
+
"DEPL"
802
811
]
803
812
},
804
813
{
805
814
"copy_cmds": [
806
-
"COPY src/ src/"
815
+
"COPY src/ src/",
816
+
"COPY DOCS.en.md .",
817
+
"COPY DOCS.ru.md ."
807
818
],
808
819
"pre_cache_cmds": [
809
-
"COPY DOCS.en.md .",
810
-
"COPY DOCS.ru.md .",
811
820
"RUN touch src/main.rs",
812
821
"RUN touch src/lib.rs",
813
-
"RUN /app/deployer run containered --current --containered --no-pipe"
822
+
"DEPL"
814
823
]
815
824
}
816
825
]
@@ -819,34 +828,29 @@ Let's look at an example of a containerized Pipeline:
819
828
}
820
829
```
821
830
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.
823
832
824
833
-`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)
828
840
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.
830
842
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:
832
844
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
836
848
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.
838
850
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.
840
852
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.
Copy file name to clipboardExpand all lines: DOCS.ru.md
+24-21Lines changed: 24 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -487,8 +487,7 @@ deployer new content
487
487
"show_bash_c": false,
488
488
"only_when_fresh": false
489
489
},
490
-
"success_when_found": "some rust regex",
491
-
"success_when_not_found": null
490
+
"success_when_found": "some rust regex"
492
491
}
493
492
```
494
493
@@ -695,12 +694,22 @@ deployer new content
695
694
696
695
#### 2.1. Контейнеризированная сборка и выполнение, а также стратегии
697
696
698
-
Деплойер поддерживает сборку и выполнение проектов в контейнеризированных окружениях с возможностью извлечения артефактов в папку проекта. Это может быть удобным в тех случаях, когда требуется сборка проекта под другие платформы и/или окружения.
697
+
Поскольку Деплойер может выполнять любые команды, он также может автоматизировать выполнение развёртывания в контейнерах и кластерах при помощи Docker- и Kubernetes-подобных платформ. Но, что самое интересное, Деплойер предоставляет автоматизацию сборки и запуска ваших Пайплайнов в контейнерах Docker и Podman с автоматической генерацией `Dockerfile`. Артефакты также будут извлечены автоматически и помещены в папку проекта. Контейнеризированная сборка может быть полезной в тех случаях, когда требуется сборка под другие платформы или в другом окружении.
699
698
700
-
Помимо этого, Деплойер позволяет указывать базовые образы, список команд для установки зависимостей и настройки образа, а также стратегии для сохранения кэшей. Совокупно это позволяет генерировать информацию для образов `Dockerfile` автоматически.
699
+
В этом плане Деплойер позволяет дополнительные функции (см. ниже).
700
+
701
+
Сборка и выполнение происходят следующим образом:
702
+
703
+
1. Формируется образ для сборки Деплойера под нужную платформу (для выполнения Пайплайнов на базе образа).
704
+
2. Собирается Деплойер.
705
+
3. Формируется образ для сборки проекта под нужную платформу - с необходимыми зависимостями и прочими командами, которые можно указать самостоятельно.
706
+
4. Если указаны стратегии кэширования сборки, Деплойер производит сборку и сохраняет кэши.
707
+
5. Деплойер на машине-хосте запускает Деплойер в контейнере и производит полное выполнение Пайплайна.
701
708
702
709
> [!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
+
> Для решения проблем синхронизации каких-то файлов или выполнения операций ввода-вывода вы можете использовать Пайплайн с опциями контейнеризированной сборки внутри другого Пайплайна, который уже сможет использовать нужные вам Действия.
704
713
705
714
Посмотрим на пример контейнеризированного Пайплайна:
"RUN /app/deployer run containered --current --containered --no-pipe"
810
+
"DEPL"
803
811
]
804
812
},
805
813
{
806
814
"copy_cmds": [
807
-
"COPY src/ src/"
815
+
"COPY src/ src/",
816
+
"COPY DOCS.en.md .",
817
+
"COPY DOCS.ru.md ."
808
818
],
809
819
"pre_cache_cmds": [
810
-
"COPY DOCS.en.md .",
811
-
"COPY DOCS.ru.md .",
812
820
"RUN touch src/main.rs",
813
821
"RUN touch src/lib.rs",
814
-
"RUN /app/deployer run containered --current --containered --no-pipe"
822
+
"DEPL"
815
823
]
816
824
}
817
825
]
@@ -826,6 +834,9 @@ deployer new content
826
834
-`preflight_cmds` - список команд для правильной установки окружения
827
835
-`build_deployer_base_image`, `preflight_deployer_build_deps` и `deployer_build_cmds` - базовый образ, команды для настройки и команды для сборки самого Деплойера
828
836
-`cache_strategies` - стратегии кэширования при сборке
837
+
-`use_containerd_local_storage_cache` - при сборке в Docker и включенной фиче `containerd` в `/etc/docker/daemon.json` позволяет сохранять кэш образов в папке выполнения Пайплайна, что упрощает очистку кэша
838
+
-`prevent_metadata_loading` - предотвращает повторное подключение к регистрам и поиск нового образа, когда доступен старый (позволяет осуществлять сборку и запуск Пайплайнов в контейнерах без доступа к Интернету)
839
+
-`executor` - позволяет указать исполнителя сборки и запуска (по умолчанию - Docker, для использования Podman укажите `podman`)
829
840
830
841
Поскольку Деплойер нужен в контейнеризированном окружении, проверяйте совместимость Деплойера и окружения путём запуска Пайплайна. Если Деплойер собран с поддержкой Python, лучше всего использовать идентичные базовые образы.
831
842
@@ -835,20 +846,12 @@ deployer new content
835
846
-`copy_cmds` - команды для копирования исходного кода в образ
836
847
-`pre_cache_cmds` - команды для предварительного кэширования
837
848
849
+
Если в качестве команды предварительного кэширования нужно выполнить Пайплайн, укажите команду `"DEPL"`. Конфигурация контейнеризированного Пайплайна будет добавлена в контейнер автоматически.
850
+
838
851
Стратегии кэширования подходят для реализации многостадийных сборок. В указанном выше примере происходит двухстадийная сборка для Rust-проекта, которая сначала требует копирования реального `Cargo.toml` и фейковых `lib.rs` и `main.rs`, чтобы сначала скомпилировать все зависимости проекта, а потом уже копирует реальный исходный код `src/` и обновляет штампы времени `RUN touch src/main.rs & touch src/lib.rs`, чтобы затем собрать проект без необходимости пересборки зависимостей. В этом случае будет использоваться кэш зависимостей до тех пор, пока `Cargo.toml` не будет отредактирован.
839
852
840
853
Для пересборки окружения с нуля запустите Деплойер с флагом `-f`/`--fresh`.
841
854
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
-
852
855
### <aid="other-entities">3. Другие сущности</a>
853
856
854
857
Одной из самых важных сущностей являются переменные. Они одновременно являются и хранителями ваших секретов, и теми самыми динамическими сущностями, которые могут поменять исход выполнения Пайплайна. Пример простой переменной:
Copy file name to clipboardExpand all lines: MIGRATIONS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Migrations guide
2
2
3
+
> Actual configs' version: `4`.
4
+
3
5
## From `1.4.0-beta-3` to `1.4.0-beta-4`
4
6
5
7
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