mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-10-01 00:19:41 +02:00
build(makefile): improve build-modules
Build the fuzzforge-modules-sdk wheel and image and derive SDK_VERSION from pyproject.toml to use as the base image for other module builds (passed via --build-arg BASE_IMAGE). Set BASE_IMG_PREFIX to "localhost/" when using Podman so local images are referenced correctly. Streamline module loop to skip the SDK dir, require a Dockerfile, preserve existing "fuzzforge-*" names, and consistently tag images as fuzzforge-<name>:<version>
This commit is contained in:
1 parent
c6e9557541
commit
1f3ffa8881
1 file changed
+19
-8
@@ -76,19 +76,30 @@ build-modules:
|
|||||||
echo "Using Podman"; \
|
echo "Using Podman"; \
|
||||||
CONTAINER_CMD="podman"; \
|
CONTAINER_CMD="podman"; \
|
||||||
fi; \
|
fi; \
|
||||||
|
BASE_IMG_PREFIX="localhost/"; \
|
||||||
else \
|
else \
|
||||||
echo "Using Docker"; \
|
echo "Using Docker"; \
|
||||||
CONTAINER_CMD="docker"; \
|
CONTAINER_CMD="docker"; \
|
||||||
|
BASE_IMG_PREFIX=""; \
|
||||||
fi; \
|
fi; \
|
||||||
|
SDK_DIR="fuzzforge-modules/fuzzforge-modules-sdk/"; \
|
||||||
|
SDK_VERSION=$$(grep 'version' "$${SDK_DIR}pyproject.toml" 2>/dev/null | head -1 | sed 's/version = //;s/"//g' || echo "0.0.1"); \
|
||||||
|
echo "Building wheels for fuzzforge-modules-sdk..."; \
|
||||||
|
(cd "$$SDK_DIR" && uv build --wheel --out-dir .wheels) || exit 1; \
|
||||||
|
echo "Building fuzzforge-modules-sdk:$$SDK_VERSION..."; \
|
||||||
|
$$CONTAINER_CMD build -t "fuzzforge-modules-sdk:$$SDK_VERSION" "$$SDK_DIR" || exit 1; \
|
||||||
for module in fuzzforge-modules/*/; do \
|
for module in fuzzforge-modules/*/; do \
|
||||||
if [ -f "$$module/Dockerfile" ] && \
|
[ "$$module" = "$$SDK_DIR" ] || [ ! -f "$$module/Dockerfile" ] && continue; \
|
||||||
[ "$$module" != "fuzzforge-modules/fuzzforge-modules-sdk/" ] && \
|
name=$$(basename $$module); \
|
||||||
[ "$$module" != "fuzzforge-modules/fuzzforge-module-template/" ]; then \
|
version=$$(grep 'version' "$$module/pyproject.toml" 2>/dev/null | head -1 | sed 's/version = //;s/"//g'); \
|
||||||
name=$$(basename $$module); \
|
case $$name in \
|
||||||
version=$$(grep 'version' "$$module/pyproject.toml" 2>/dev/null | head -1 | sed 's/.*"\(.*\\)".*/\\1/' || echo "0.1.0"); \
|
fuzzforge-*) tag="$$name:$$version" ;; \
|
||||||
echo "Building $$name:$$version..."; \
|
*) tag="fuzzforge-$$name:$$version" ;; \
|
||||||
$$CONTAINER_CMD build -t "fuzzforge-$$name:$$version" "$$module" || exit 1; \
|
esac; \
|
||||||
fi \
|
echo "Building $$tag..."; \
|
||||||
|
$$CONTAINER_CMD build \
|
||||||
|
--build-arg BASE_IMAGE="$${BASE_IMG_PREFIX}fuzzforge-modules-sdk:$$SDK_VERSION" \
|
||||||
|
-t "$$tag" "$$module" || exit 1; \
|
||||||
done
|
done
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "✓ All modules built successfully!"
|
@echo "✓ All modules built successfully!"
|
||||||
|
|||||||
Reference in new issue
Block a user