-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff567f9
commit 96877e8
Showing
7 changed files
with
398 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @valorem-labs-inc/devops |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: 'Deploy container to latest tag' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-latest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push the container to GitHub Container Registry using the latest tag | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
platforms: linux/arm64 | ||
tags: ghcr.io/valorem-labs-inc/anvil-runner:latest | ||
push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Validate Repo' | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
- name: Install pylint | ||
run: pip install pylint | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: 'Deploy container to named tag' | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*.*.*' | ||
|
||
jobs: | ||
build-tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Extract tag name | ||
id: extract_tag | ||
run: echo "::set-output name=tag::${GITHUB_REF/refs\/tags\//}" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push the container to GitHub Container Registry using the repo tag | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
platforms: linux/arm64 | ||
tags: ghcr.io/valorem-labs-inc/anvil-runner:${{ steps.extract_tag.outputs.tag }} | ||
push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,251 @@ | ||
################ | ||
## Sublime Text | ||
################ | ||
|
||
*.sublime-workspace | ||
|
||
################# | ||
## JetBrain IDEs | ||
################# | ||
|
||
## Directory-based project format | ||
.idea/ | ||
# if you remove the above rule, at least ignore user-specific stuff: | ||
# .idea/workspace.xml | ||
# .idea/tasks.xml | ||
# and these sensitive or high-churn files: | ||
# .idea/dataSources.ids | ||
# .idea/dataSources.xml | ||
# .idea/sqlDataSources.xml | ||
# .idea/dynamic.xml | ||
|
||
## File-based project format | ||
*.ipr | ||
*.iml | ||
*.iws | ||
|
||
## Additional for IntelliJ | ||
out/ | ||
|
||
# generated by mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# generated by JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# generated by Crashlytics plugin (for Android Studio and Intellij) | ||
com_crashlytics_export_strings.xml | ||
|
||
################# | ||
## Visual Studio | ||
################# | ||
|
||
## Ignore Visual Studio temporary files, build results, and | ||
## files generated by popular Visual Studio add-ons. | ||
|
||
# User-specific files | ||
*.suo | ||
*.user | ||
*.sln.docstates | ||
|
||
# Build results | ||
|
||
[Dd]ebug/ | ||
[Rr]elease/ | ||
x64/ | ||
build/ | ||
[Bb]in/ | ||
[Oo]bj/ | ||
|
||
# MSTest test Results | ||
[Tt]est[Rr]esult*/ | ||
[Bb]uild[Ll]og.* | ||
|
||
*_i.c | ||
*_p.c | ||
*.ilk | ||
*.meta | ||
*.obj | ||
*.pch | ||
*.pdb | ||
*.pgc | ||
*.pgd | ||
*.rsp | ||
*.sbr | ||
*.tlb | ||
*.tli | ||
*.tlh | ||
*.tmp | ||
*.tmp_proj | ||
*.log | ||
*.vspscc | ||
*.vssscc | ||
.builds | ||
*.pidb | ||
*.log | ||
*.scc | ||
|
||
# Visual C++ cache files | ||
ipch/ | ||
*.aps | ||
*.ncb | ||
*.opensdf | ||
*.sdf | ||
*.cachefile | ||
|
||
# Visual Studio profiler | ||
*.psess | ||
*.vsp | ||
*.vspx | ||
|
||
# Guidance Automation Toolkit | ||
*.gpState | ||
|
||
# ReSharper is a .NET coding add-in | ||
_ReSharper*/ | ||
*.[Rr]e[Ss]harper | ||
|
||
# TeamCity is a build add-in | ||
_TeamCity* | ||
|
||
# DotCover is a Code Coverage Tool | ||
*.dotCover | ||
|
||
# NCrunch | ||
*.ncrunch* | ||
.*crunch*.local.xml | ||
|
||
# Installshield output folder | ||
[Ee]xpress/ | ||
|
||
# DocProject is a documentation generator add-in | ||
DocProject/buildhelp/ | ||
DocProject/Help/*.HxT | ||
DocProject/Help/*.HxC | ||
DocProject/Help/*.hhc | ||
DocProject/Help/*.hhk | ||
DocProject/Help/*.hhp | ||
DocProject/Help/Html2 | ||
DocProject/Help/html | ||
|
||
# Click-Once directory | ||
publish/ | ||
|
||
# Publish Web Output | ||
*.Publish.xml | ||
*.pubxml | ||
|
||
# NuGet Packages Directory | ||
#packages/ | ||
|
||
# Windows Azure Build Output | ||
csx | ||
*.build.csdef | ||
|
||
# Windows Store app package directory | ||
AppPackages/ | ||
|
||
# Others | ||
sql/ | ||
*.Cache | ||
ClientBin/ | ||
[Ss]tyle[Cc]op.* | ||
~$* | ||
*~ | ||
*.dbmdl | ||
*.[Pp]ublish.xml | ||
*.pfx | ||
*.publishsettings | ||
|
||
# RIA/Silverlight projects | ||
Generated_Code/ | ||
|
||
# Backup & report files from converting an old project file to a newer | ||
# Visual Studio version. Backup files are not needed, because we have git ;-) | ||
_UpgradeReport_Files/ | ||
Backup*/ | ||
UpgradeLog*.XML | ||
UpgradeLog*.htm | ||
|
||
# SQL Server files | ||
App_Data/*.mdf | ||
App_Data/*.ldf | ||
|
||
############### | ||
## Common Keys | ||
############### | ||
|
||
# Ansible vault key | ||
vault.key | ||
|
||
#################### | ||
## Windows detritus | ||
#################### | ||
|
||
# Windows image file caches | ||
Thumbs.db | ||
ehthumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
################ | ||
## Mac detritus | ||
################ | ||
|
||
.DS_Store | ||
|
||
################# | ||
## Chef detritus | ||
################# | ||
|
||
# Berkshelf | ||
.vagrant | ||
/cookbooks | ||
Berksfile.lock | ||
|
||
# Bundler | ||
Gemfile.lock | ||
bin/* | ||
.bundle/* | ||
|
||
.kitchen/ | ||
.kitchen.local.yml | ||
|
||
#################### | ||
## Ansible detritus | ||
#################### | ||
|
||
#Retry files | ||
*.retry | ||
|
||
###################### | ||
## Terraform detritus | ||
###################### | ||
|
||
# Local Terraform states | ||
.terraform/ | ||
|
||
|
||
#################### | ||
## Generic detritus | ||
#################### | ||
|
||
*~ | ||
*# | ||
.#* | ||
\#*# | ||
.*.sw[a-z] | ||
*.un~ | ||
pkg/ | ||
|
||
#################### | ||
## Pytohn detritus | ||
#################### | ||
|
||
# Virtual environments | ||
pyenv/ | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
FROM lukemathwalker/cargo-chef:latest-rust-1.72.1 as chef | ||
WORKDIR /opt | ||
|
||
FROM chef as planner | ||
|
||
# Get the foundry project | ||
RUN git clone https://github.com/foundry-rs/foundry.git | ||
|
||
WORKDIR /opt/foundry | ||
|
||
# Compute a lock-like file for our project | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
FROM chef as builder | ||
|
||
WORKDIR /opt/foundry | ||
|
||
# Get the foundry project | ||
COPY --from=planner /opt/foundry /opt/foundry | ||
# Get the lock-like file | ||
COPY --from=planner /opt/foundry/recipe.json recipe.json | ||
|
||
|
||
# Build our project dependencies, not our application! | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
# Up to this point, if our dependency tree stays the same, | ||
# all layers should be cached. | ||
RUN cargo build --release | ||
|
||
FROM debian:bookworm-slim AS foundry-environment | ||
|
||
# Foundry tools | ||
COPY --from=builder /opt/foundry/target/release/forge /usr/local/bin/forge | ||
COPY --from=builder /opt/foundry/target/release/cast /usr/local/bin/cast | ||
COPY --from=builder /opt/foundry/target/release/anvil /usr/local/bin/anvil | ||
COPY --from=builder /opt/foundry/target/release/chisel /usr/local/bin/chisel | ||
|
||
RUN useradd -u 1001 -m foundry | ||
|
||
USER foundry | ||
|
||
# TODO(User and group here) | ||
|
||
ENTRYPOINT ["/bin/sh", "-c"] | ||
|
||
FROM foundry-environment as anvil | ||
|
||
# At this point we have the entire toolchain for foundry | ||
|
||
# Start a clean anvil chain | ||
EXPOSE 8545 | ||
|
||
ENTRYPOINT ["/usr/local/bin/anvil"] |
Oops, something went wrong.