Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
CLEVER_APP_ID: ${{ secrets.BE_CLEVER_APP_ID_PROD }}
APP_NAME: cc_api_prod
run: |
uv pip compile carbonserver/pyproject.toml > requirements/requirements-api.txt
uv pip compile pyproject.toml --extra api --output-file requirements/requirements-api.txt
./clever-tools-latest_linux/clever link $CLEVER_APP_ID
./clever-tools-latest_linux/clever deploy -f

Expand Down
38 changes: 23 additions & 15 deletions carbonserver/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,48 @@
# Dockerfile

# Use Ubuntu to install 3 versions of Python for testing
# For production, you could use python:3.8-slim
# Use Ubuntu to install Python and uv
# For production, you could use python:3.11-slim

FROM ubuntu:22.04@sha256:3c61d3759c2639d4b836d32a2d3c83fa0214e36f195a3421018dbaaf79cbe37f

# set work directory
WORKDIR /carbonserver
WORKDIR /app
# set env variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Prevent apt to ask for region
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get upgrade -y && \
apt-get install -y software-properties-common && \
apt-get install -y software-properties-common curl && \
add-apt-repository ppa:deadsnakes/ppa -y && \
apt-get update && \
apt-get install -y gcc libpq-dev python3.11 python3-pip
apt-get install -y gcc libpq-dev python3.11 python3.11-dev

# Copy the requirements file from the project root
# COPY ./requirements/requirements-dev.txt /carbonserver/requirements-dev.txt
# RUN pip install -r /carbonserver/requirements-dev.txt
RUN ln -sf /usr/bin/python3.11 /usr/bin/python && \
ln -sf /usr/bin/python3.11 /usr/bin/python3

RUN ln -sf /usr/bin/pip3 /usr/bin/pip && \
ln -sf /usr/bin/python3.11 /usr/bin/python && \
ln -sf /usr/bin/python3.11 /usr/bin/python3
# Download the latest UV installer
ADD https://astral.sh/uv/install.sh /uv-installer.sh

COPY ./requirements/requirements-api.txt /carbonserver/requirements-api.txt
RUN pip install -r /carbonserver/requirements-api.txt --require-hashes
# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh

# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.local/bin/:$PATH"

# Copy project files
COPY pyproject.toml /app/
COPY codecarbon /app/codecarbon
COPY carbonserver /app/carbonserver

# Install dependencies using uv with the api dependency group
RUN uv pip install --system -e ".[api]"

COPY ./carbonserver/docker/entrypoint.sh /opt
RUN chmod a+x /opt/entrypoint.sh

# Copy everything from carbonserver directory to the container
COPY carbonserver /carbonserver
WORKDIR /app/carbonserver

EXPOSE 8000
ENTRYPOINT ["/opt/entrypoint.sh"]
263 changes: 0 additions & 263 deletions requirements/requirements-api.txt

This file was deleted.

4 changes: 2 additions & 2 deletions webapp/src/components/projectTokens/projectTokenTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ export const ProjectTokensTable = ({ projectId }: { projectId: string }) => {
</div>
<p className="text-l mt-4 p-2">
Make sure to copy the token above as it will not be
shown again. We&apos;ll don&apos;t store it for
security reasons.
shown again. We don&apos;t store it for security
reasons.
</p>
<Button onClick={resetTokenCreation} className="mt-4">
Done
Expand Down
Loading