swapping back to podman

This commit is contained in:
John Doe
2025-11-23 13:20:08 -05:00
parent a32bbb9081
commit 87e90c0ba2
2 changed files with 22 additions and 31 deletions

View File

@@ -48,23 +48,14 @@ GFX_ARCHITECTURES["gfx1101"]="RDNA 3 (RX 7800 XT/7700 XT)"
GFX_ARCHITECTURES["gfx1030"]="RDNA 2 (RX 6000 series)" GFX_ARCHITECTURES["gfx1030"]="RDNA 2 (RX 6000 series)"
GFX_ARCHITECTURES["gfx1201"]="RDNA 4 (RX 9060 XT/ RX 9070/XT)" GFX_ARCHITECTURES["gfx1201"]="RDNA 4 (RX 9060 XT/ RX 9070/XT)"
# Check if docker is available # Check if podman is available
if ! command -v docker &> /dev/null; then if ! command -v podman &> /dev/null; then
print_error "docker is not installed or not in PATH" print_error "podman is not installed or not in PATH"
exit 1 exit 1
fi fi
# Ensure BuildKit is enabled and create buildx builder if needed
export DOCKER_BUILDKIT=1
if ! docker buildx ls | grep -q "rocm-builder"; then
print_step "Creating Docker buildx builder..."
docker buildx create --name rocm-builder --use --driver docker-container
else
print_step "Using existing buildx builder..."
docker buildx use rocm-builder
fi
print_step "Building stable-diffusion.cpp docker images for different AMD GPU architectures..." print_step "Building stable-diffusion.cpp podman images for different AMD GPU architectures..."
echo "" echo ""
# Build images for each architecture # Build images for each architecture
@@ -73,9 +64,9 @@ for gfx_name in "${!GFX_ARCHITECTURES[@]}"; do
image_tag="${REGISTRY}/${BASE_IMAGE_NAME}:${gfx_name}" image_tag="${REGISTRY}/${BASE_IMAGE_NAME}:${gfx_name}"
print_step "Building for ${gfx_name} - ${architecture_desc}..." print_step "Building for ${gfx_name} - ${architecture_desc}..."
echo -e "${YELLOW}Command: docker buildx build -t ${image_tag} --build-arg GFX_NAME=${gfx_name} -f ${Dockerfiles_DIR}/Dockerfile.stable-diffusion.cpp-rocm7.1 --load .${NC}" echo -e "${YELLOW}Command: podman build -t ${image_tag} --build-arg GFX_NAME=${gfx_name} -f ${Dockerfiles_DIR}/Dockerfile.stable-diffusion.cpp-rocm7.1 --load .${NC}"
if docker buildx build -t "${image_tag}" \ if podman build -t "${image_tag}" \
--build-arg GFX_NAME="${gfx_name}" \ --build-arg GFX_NAME="${gfx_name}" \
-f "${Dockerfiles_DIR}/Dockerfile.stable-diffusion.cpp-rocm7.1" \ -f "${Dockerfiles_DIR}/Dockerfile.stable-diffusion.cpp-rocm7.1" \
--load \ --load \
@@ -99,7 +90,7 @@ for gfx_name in "${!GFX_ARCHITECTURES[@]}"; do
architecture_desc="${GFX_ARCHITECTURES[$gfx_name]}" architecture_desc="${GFX_ARCHITECTURES[$gfx_name]}"
print_step "Pushing ${image_tag} (${architecture_desc})..." print_step "Pushing ${image_tag} (${architecture_desc})..."
if docker push "${image_tag}"; then if podman push "${image_tag}"; then
print_success "Pushed ${image_tag} successfully" print_success "Pushed ${image_tag} successfully"
else else
print_error "Failed to push ${image_tag}" print_error "Failed to push ${image_tag}"
@@ -122,7 +113,7 @@ for gfx_name in "${!GFX_ARCHITECTURES[@]}"; do
done done
echo "" echo ""
echo -e "${CYAN}To run an image:${NC}" echo -e "${CYAN}To run an image:${NC}"
echo -e " ${YELLOW}docker run -it --device=/dev/kfd --device=/dev/dri --group-add video -p 7860:7860 ${REGISTRY}/${BASE_IMAGE_NAME}:<gfx_name>${NC}" echo -e " ${YELLOW}podman run -it --device=/dev/kfd --device=/dev/dri --group-add video -p 7860:7860 ${REGISTRY}/${BASE_IMAGE_NAME}:<gfx_name>${NC}"
echo "" echo ""
echo -e "${CYAN}Example for RDNA 3:${NC}" echo -e "${CYAN}Example for RDNA 3:${NC}"
echo -e " ${YELLOW}docker run -it --device=/dev/kfd --device=/dev/dri --group-add video -p 7860:7860 ${REGISTRY}/${BASE_IMAGE_NAME}:gfx1100${NC}" echo -e " ${YELLOW}podman run -it --device=/dev/kfd --device=/dev/dri --group-add video -p 7860:7860 ${REGISTRY}/${BASE_IMAGE_NAME}:gfx1100${NC}"

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# ROCm 7.1 Docker Build and Push Script # ROCm 7.1 podman Build and Push Script
# Builds and pushes fedora-rocm7.1, ollama-rocm7.1, stable-diffusion.cpp-rocm7.1, and comfyui-rocm7.1 images # Builds and pushes fedora-rocm7.1, ollama-rocm7.1, stable-diffusion.cpp-rocm7.1, and comfyui-rocm7.1 images
set -e set -e
@@ -20,7 +20,7 @@ OLLAMA_IMAGE="ollama-rocm7.1"
Dockerfiles_DIR="./Dockerfiles" Dockerfiles_DIR="./Dockerfiles"
echo -e "${BLUE}========================================${NC}" echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE} ROCm 7.1 Docker Build Script ${NC}" echo -e "${BLUE} ROCm 7.1 podman Build Script ${NC}"
echo -e "${BLUE}========================================${NC}" echo -e "${BLUE}========================================${NC}"
echo "" echo ""
@@ -39,15 +39,15 @@ print_error() {
echo -e "${RED}$1${NC}" echo -e "${RED}$1${NC}"
} }
# Check if docker is available # Check if podman is available
if ! command -v docker &> /dev/null; then if ! command -v podman &> /dev/null; then
print_error "docker is not installed or not in PATH" print_error "podman is not installed or not in PATH"
exit 1 exit 1
fi fi
print_step "Building Fedora ROCm 7.1 base image..." print_step "Building Fedora ROCm 7.1 base image..."
echo -e "${YELLOW}Command: docker build -t ${FEDORA_IMAGE}:latest -f ${Dockerfiles_DIR}/Dockerfile.rocm-7.1 .${NC}" echo -e "${YELLOW}Command: podman build -t ${FEDORA_IMAGE}:latest -f ${Dockerfiles_DIR}/Dockerfile.rocm-7.1 .${NC}"
if docker build -t "${FEDORA_IMAGE}:latest" -f "${Dockerfiles_DIR}/Dockerfile.rocm-7.1" .; then if podman build -t "${FEDORA_IMAGE}:latest" -f "${Dockerfiles_DIR}/Dockerfile.rocm-7.1" .; then
print_success "Fedora ROCm 7.1 image built successfully" print_success "Fedora ROCm 7.1 image built successfully"
else else
print_error "Failed to build Fedora ROCm 7.1 image" print_error "Failed to build Fedora ROCm 7.1 image"
@@ -55,7 +55,7 @@ else
fi fi
print_step "Tagging Fedora ROCm 7.1 image for registry..." print_step "Tagging Fedora ROCm 7.1 image for registry..."
if docker tag "${FEDORA_IMAGE}:latest" "${REGISTRY}/${FEDORA_IMAGE}:latest"; then if podman tag "${FEDORA_IMAGE}:latest" "${REGISTRY}/${FEDORA_IMAGE}:latest"; then
print_success "Tagged: ${REGISTRY}/${FEDORA_IMAGE}:latest" print_success "Tagged: ${REGISTRY}/${FEDORA_IMAGE}:latest"
else else
print_error "Failed to tag Fedora ROCm 7.1 image" print_error "Failed to tag Fedora ROCm 7.1 image"
@@ -63,7 +63,7 @@ else
fi fi
print_step "Pushing Fedora ROCm 7.1 image to registry..." print_step "Pushing Fedora ROCm 7.1 image to registry..."
if docker push "${REGISTRY}/${FEDORA_IMAGE}:latest"; then if podman push "${REGISTRY}/${FEDORA_IMAGE}:latest"; then
print_success "Pushed: ${REGISTRY}/${FEDORA_IMAGE}:latest" print_success "Pushed: ${REGISTRY}/${FEDORA_IMAGE}:latest"
else else
print_error "Failed to push Fedora ROCm 7.1 image" print_error "Failed to push Fedora ROCm 7.1 image"
@@ -88,9 +88,9 @@ else
fi fi
print_step "Building Ollama ROCm 7.1 image..." print_step "Building Ollama ROCm 7.1 image..."
echo -e "${YELLOW}Command: docker build -t ${OLLAMA_IMAGE}:latest --build-arg FLAVOR=rocm .${NC}" echo -e "${YELLOW}Command: podman build -t ${OLLAMA_IMAGE}:latest --build-arg FLAVOR=rocm .${NC}"
cd ollama-linux-amd-apu cd ollama-linux-amd-apu
if docker build -t "${OLLAMA_IMAGE}:latest" --build-arg FLAVOR=rocm .; then if podman build -t "${OLLAMA_IMAGE}:latest" --build-arg FLAVOR=rocm .; then
print_success "Ollama ROCm 7.1 image built successfully" print_success "Ollama ROCm 7.1 image built successfully"
cd .. cd ..
else else
@@ -99,7 +99,7 @@ else
fi fi
print_step "Tagging Ollama ROCm 7.1 image for registry..." print_step "Tagging Ollama ROCm 7.1 image for registry..."
if docker tag "${OLLAMA_IMAGE}:latest" "${REGISTRY}/${OLLAMA_IMAGE}:latest"; then if podman tag "${OLLAMA_IMAGE}:latest" "${REGISTRY}/${OLLAMA_IMAGE}:latest"; then
print_success "Tagged: ${REGISTRY}/${OLLAMA_IMAGE}:latest" print_success "Tagged: ${REGISTRY}/${OLLAMA_IMAGE}:latest"
else else
print_error "Failed to tag Ollama ROCm 7.1 image" print_error "Failed to tag Ollama ROCm 7.1 image"
@@ -107,7 +107,7 @@ else
fi fi
print_step "Pushing Ollama ROCm 7.1 image to registry..." print_step "Pushing Ollama ROCm 7.1 image to registry..."
if docker push "${REGISTRY}/${OLLAMA_IMAGE}:latest"; then if podman push "${REGISTRY}/${OLLAMA_IMAGE}:latest"; then
print_success "Pushed: ${REGISTRY}/${OLLAMA_IMAGE}:latest" print_success "Pushed: ${REGISTRY}/${OLLAMA_IMAGE}:latest"
else else
print_error "Failed to push Ollama ROCm 7.1 image" print_error "Failed to push Ollama ROCm 7.1 image"