Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows runner #52

Closed
kichik opened this issue Jun 21, 2022 · 7 comments · Fixed by #94
Closed

Windows runner #52

kichik opened this issue Jun 21, 2022 · 7 comments · Fixed by #94

Comments

@kichik
Copy link
Member

kichik commented Jun 21, 2022

No description provided.

@RichiCoder1
Copy link

If there's any pointers here, I'd be interested in possible trying to PoC or contribute this!

@kichik
Copy link
Member Author

kichik commented Jun 28, 2022

Thanks @RichiCoder1 ! There are two steps required to get there. First we need a Dockerfile that defines an image including the runner, awscli, gh, and latest git. It should be named src/providers/docker-images/codebuild/linux-x64/Dockerfile. If we can get it working on arm64 and/or Fargate too, that'd be even better. That part I could really use the help as Docker refuses to build Windows images on my machine.

The second part is building this image. We can't use CodeBuild to build Windows Docker images because CodeBuild doesn't support that. I am working on adding support for AWS Image Builder to build images for Windows. It will be needed for EC2 support too as those need AMI and CodeBuild can't build them too easily. If you're interested in helping on this part too, I can push what I have to a branch. It's still very raw.

@RichiCoder1
Copy link

RichiCoder1 commented Jun 28, 2022

@kichik Certainly! I know docker and windows is its own fun circus to get working, something we're currently working on which prompted this request :)

@kichik
Copy link
Member Author

kichik commented Jul 23, 2022

This is the Dockerfile I have for now. I was able to get it running manually. We would still need to use AWS Image Builder to build it and update CodeBuild to use it with PowerShell.

FROM mcr.microsoft.com/windows/servercore:ltsc2019

WORKDIR /tmp

# awscli
RUN msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi

# github cli
RUN curl -w "%{redirect_url}" -fsS https://github.com/cli/cli/releases/latest | powershell $X = $Input -Split '/'; $GH_VERSION = $X[-1].substring(1); \
    $ProgressPreference = 'SilentlyContinue'; \
    Invoke-WebRequest -UseBasicParsing -Uri "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_windows_amd64.msi" -OutFile gh.msi && \
    msiexec.exe /i gh.msi && del gh.msi

# git
RUN curl -fsSL https://github.com/git-for-windows/git/releases/download/v2.37.1.windows.1/Git-2.37.1-64-bit.exe -o git-setup.exe && git-setup.exe /VERYSILENT && del git-setup.exe

# runner
ARG RUNNER_VERSION=latest
WORKDIR /actions
RUN curl -w "%{redirect_url}" -fsS https://github.com/actions/runner/releases/latest | powershell $X = $Input -Split '/'; $RUNNER_VERSION = $Env:RUNNER_VERSION; if ($RUNNER_VERSION -eq 'latest') { $RUNNER_VERSION = $X[-1].substring(1) }; \
    $ProgressPreference = 'SilentlyContinue'; \
    Invoke-WebRequest -UseBasicParsing -Uri "https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip" -OutFile actions.zip; \
    Expand-Archive actions.zip -DestinationPath . && del actions.zip

kichik added a commit that referenced this issue Sep 2, 2022
Build Windows Docker images using AWS Image Builder and run them on CodeBuild.

Resolves #52

BREAKING CHANGE: CDK 2.29.0 and above is required
@kichik
Copy link
Member Author

kichik commented Sep 6, 2022

@RichiCoder1 would you be able to take a look at PR #94 and maybe even try it?

@mergify mergify bot closed this as completed in #94 Sep 8, 2022
mergify bot pushed a commit that referenced this issue Sep 8, 2022
Build Windows Docker images using AWS Image Builder and run them on CodeBuild.

Resolves #52

BREAKING CHANGE: CDK 2.29.0 and above is required
@RichiCoder1
Copy link

@kichik Apologies, I just saw this 😅

@kichik
Copy link
Member Author

kichik commented Sep 8, 2022

@RichiCoder1 no worries. I plan to release probably this weekend, but any feedback would be appreciated even after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants