explicit repo name in pods/external (#8929)

Signed-off-by: Alexey Aristov <aav@acm.org>
This commit is contained in:
Alexey Aristov
2025-05-14 22:12:24 +07:00
committed by GitHub
parent 132e94588f
commit ac39d61bb2
4 changed files with 46 additions and 14 deletions
+27
View File
@@ -0,0 +1,27 @@
# External Pods Integration
A container for integrating external Docker images into the build process.
Implements two entry points consumed by the Rush build process: "docker:build" and "docker:push".
## docker:build
Imports external images into the local registry. The `services.d/` directory contains files that describe external images. A 'local' tag is applied to imported images.
## docker:push
Copies external images into the official registry (hardcoreeng). A git-based `git describe --tags --abbrev=0` tag is applied to copied images.
## Configuration
Each file in the `services.d/` directory describes a single external image. Only the first line in every file is used. The line should follow this format:
```
<repository> <external_registry>/<repository>:<tag>
```
If the file name starts with "-", it will be ignored. Lines starting with "#" are also ignored.
## More information
More details are available in the [Design Document](https://app.hc.engineering/workbench/platform/document/external-services-build-682232fa8c2a2eb48ffe47d5)
+9 -7
View File
@@ -4,16 +4,18 @@ registry=hardcoreeng
tag=latest
find services.d/ -type f -name "*.service" ! -name "-*" | sort | while read -r file; do
extern=$(cat $file | grep -v -e '^[[:space:]]*$' -e '^#' | head -n 1 | tr -d '[:space:]')
line=$(cat $file | grep -v -e '^[[:space:]]*$' -e '^#' | head -n 1)
if [ ! -z $extern ]; then
repo=$(echo $extern | cut -d'/' -f2 | cut -d':' -f1)
pulled=$(docker pull --quiet $extern)
local=$registry/$repo:$tag
target_repo=$(echo $line | cut -d ' ' -f1 | tr -d '[:space:]')
source=$(echo $line | cut -d ' ' -f2 | tr -d '[:space:]')
docker tag $extern $local
if [ ! -z $target_repo ] && [ ! -z $source ]; then
target=$registry/$target_repo:$tag
echo "Pull&Tag: $pulled -> $local"
docker pull --quiet $source > /dev/null
docker tag $source $target
echo "Pull&Tag: $source -> $target"
fi
done
+9 -6
View File
@@ -4,14 +4,17 @@ registry=hardcoreeng
tag=$(git describe --tags --abbrev=0)
find services.d/ -type f -name "*.service" ! -name "-*" | sort | while read -r file; do
extern=$(cat $file | grep -v -e '^[[:space:]]*$' -e '^#' | head -n 1 | tr -d '[:space:]')
line=$(cat $file | grep -v -e '^[[:space:]]*$' -e '^#' | head -n 1)
if [ ! -z $extern ]; then
repo=$(echo $extern | cut -d'/' -f2 | cut -d':' -f1)
local=$registry/$repo:$tag
docker buildx imagetools create --tag $local $extern
target_repo=$(echo $line | cut -d ' ' -f1 | tr -d '[:space:]')
source=$(echo $line | cut -d ' ' -f2 | tr -d '[:space:]')
echo "Copy: $extern -> $local"
if [ ! -z $target_repo ] && [ ! -z $source ]; then
target=$registry/$target_repo:$tag
docker buildx imagetools create --tag $target $source
echo "Copy: $source -> $target"
fi
done
+1 -1
View File
@@ -1 +1 @@
aristov/hulykvs:0.1.1
hulykvs hardcoreeng/service_hulykvs:0.2.0