Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/AutoTuner/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/*.venv
**/__pycache__
**/*.egg-info
**/*.env
**/*test
**/*.json
autotuner_env
*.log
3 changes: 3 additions & 0 deletions tools/AutoTuner/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ __pycache__/
# Autotuner env
autotuner_env
.env

# Log files
docker-build.log
25 changes: 25 additions & 0 deletions tools/AutoTuner/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-openroad/orfs:latest}

# Set workdir
WORKDIR /OpenROAD-flow-scripts/tools/AutoTuner

# Replace pre-existing AT files with local copy
RUN rm -rf /OpenROAD-flow-scripts/tools/AutoTuner

# Create venv
RUN python3 -m venv .venv
ENV PATH="/OpenROAD-flow-scripts/tools/AutoTuner/.venv:${PATH}"

# Copy only requirements first for better caching of pip install
COPY requirements.txt .

# Upgrade pip and install Python dependencies
RUN pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir -r requirements.txt

# Copy full source after installing dependencies
COPY . .

# Install package in editable mode
RUN pip3 install --no-cache-dir -e .
28 changes: 28 additions & 0 deletions tools/AutoTuner/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
include .env
export

BASE_TAG=$(shell cd ../../ && ./etc/DockerTag.sh -dev)
ORFS_IMAGE := openroad/orfs:latest
ORFS_AUTOTUNER_IMAGE := orfs-autotuner

.PHONY: clean
clean:
@echo "Cleaning up old images"
@docker rmi ${ORFS_AUTOTUNER_IMAGE}:latest || true

.PHONY: docker
docker: clean
@echo "Building docker image..."
@docker build -t ${ORFS_AUTOTUNER_IMAGE}:latest -f Dockerfile --build-arg BASE_IMAGE=${ORFS_IMAGE} . | tee docker-build.log
@docker tag ${ORFS_AUTOTUNER_IMAGE}:latest ${ORFS_AUTOTUNER_IMAGE}:$(BASE_TAG)

.PHONY: upload
upload: docker
@echo "Uploading docker image..."
@docker login -u $(DOCKERHUB_USERNAME) -p $(DOCKERHUB_PASSWORD)
@echo "Base image: $(BASE_TAG)"
@docker tag ${ORFS_AUTOTUNER_IMAGE}:latest ${DOCKERHUB_USERNAME}/${ORFS_AUTOTUNER_IMAGE}:$(BASE_TAG)
@docker tag ${ORFS_AUTOTUNER_IMAGE}:latest ${DOCKERHUB_USERNAME}/${ORFS_AUTOTUNER_IMAGE}:latest
@docker push ${DOCKERHUB_USERNAME}/${ORFS_AUTOTUNER_IMAGE}:$(BASE_TAG)
@docker push ${DOCKERHUB_USERNAME}/${ORFS_AUTOTUNER_IMAGE}:latest
@docker logout