carbon-aware-sdk icon indicating copy to clipboard operation
carbon-aware-sdk copied to clipboard

[Feature Contribution]: Publish the docker file in a docker registry

Open luwangshell opened this issue 2 years ago • 6 comments

What happened?

It would be good to publish the docker image to a docker registry (e.g. GitHub Packages) so we could just consume and pass in the version of the sdk.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Feature Commitment

  • [X] I commit to contributing this feature as a PR and working with the GSF to merge this feature into the Carbon Aware SDK.

luwangshell avatar Jan 25 '23 13:01 luwangshell

Right now we have to do something like this:

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env

RUN wget https://github.com/Green-Software-Foundation/carbon-aware-sdk/archive/refs/tags/v1.0.0.zip

RUN apt-get update && \
  apt-get install unzip && \
  unzip v1.0.0.zip && \
  rm v1.0.0.zip

WORKDIR /carbon-aware-sdk-1.0.0/src
RUN dotnet publish CarbonAware.WebApi/src/CarbonAware.WebApi.csproj -c Release -o publish

FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /carbon-aware-sdk-1.0.0/src
COPY --from=build-env /carbon-aware-sdk-1.0.0/src/publish .

ENTRYPOINT ["dotnet", "CarbonAware.WebApi.dll"]

A few things would be a massive improvement in using the library:

  • Releasing versions more often. The last version was Oct. 22 and is 1.0.0 and quite out of date
  • Making your releases as packages. In the above code I have to wget the 1.0.0 manually because there's no package to install from a repo like docker or npm.
  • Publish your DockerFile to a registry so that we can easily consume them. If you did this then I wouldn't need to manually write the above DockerFile to use 1.0.0. I could just pull in your image in my docker-compose and pass the version in I wanted, i.e 1.0.0

Thanks for this great repo though, it's really amazing.

MartinDawson avatar Jan 25 '23 13:01 MartinDawson

This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.

github-actions[bot] avatar May 26 '23 06:05 github-actions[bot]

Hi, thank you for those comments and sorry for the delay. We are in the process of making some of those changes, but feel free to create pull request or send links if there is anything missing. (Do you have a link for the scenario to publish registry to a container or what we have in the repo is enough now please?

danuw avatar Jun 05 '23 22:06 danuw

You already can pull WebAPI container image from GitHub Packages. Is it enough? https://github.com/Green-Software-Foundation/carbon-aware-sdk/pkgs/container/carbon-aware-sdk

YaSuenag avatar Sep 29 '23 07:09 YaSuenag

This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.

github-actions[bot] avatar Jan 28 '24 06:01 github-actions[bot]

I think we can close this issue.

YaSuenag avatar Jan 28 '24 09:01 YaSuenag

This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.

github-actions[bot] avatar May 28 '24 06:05 github-actions[bot]

Closing because we use GitHub Packages to publish WebAPI container image.

Sophietn avatar May 28 '24 07:05 Sophietn