Skip to content

Dockerfile bug fix #503

@phgupta

Description

@phgupta

The Dockerfile in the buildstockbatch repo for version v2024.11.0 doesn't build successfully. Specifically, the repo does not include the Gemfile referenced in this line, causing a COPY error during the Docker build.

To work around this, I commented out lines 14–26 in the Dockerfile and rebuilt the image. While the Docker image built successfully, I later encountered this error in AWS CloudWatch logs:
/usr/bin/python3: Error while finding module specification for 'buildstockbatch.aws.aws' (ModuleNotFoundError: No module named 'buildstockbatch')

Here's a working version of the Dockerfile with the necessary fixes,

ARG OS_VER
FROM --platform=linux/amd64 nrel/openstudio:$OS_VER as buildstockbatch
ARG CLOUD_PLATFORM=aws
ENV DEBIAN_FRONTEND=noninteractive
COPY . /buildstock-batch/
COPY nrel_root_ca.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates

# PG: Set working directory from /var/simdata/openstudio to /buildstock-batch
WORKDIR /buildstock-batch

RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:/root/.cargo/bin:$PATH"
RUN uv python install 3.11

# PG: Since working directory is set to /buildstock-batch, use relative path
RUN uv venv --python 3.11 && uv pip install ".[${CLOUD_PLATFORM}]"

# PG: Add venv to PATH so Docker runs within the virtual environment
ENV PATH="/buildstock-batch/.venv/bin:$PATH"

Platform (please complete the following information):

  • Simulation platform: AWS
  • BuildStockBatch version, branch, or sha: v2024.11.0
  • resstock or comstock repo version, branch, or sha: v3.4.0
  • Local Desktop OS: Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions