Skip to content

Commit

Permalink
Update devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Dec 10, 2023
2 parents 1a41979 + a08f2cb commit 4d441bf
Show file tree
Hide file tree
Showing 19 changed files with 1,159 additions and 114 deletions.
30 changes: 12 additions & 18 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust/.devcontainer/base.Dockerfile

# [Choice] Debian OS version (use 0-bullseye on local arm64/Apple Silicon): 0-buster, 0-bullseye bookworm
# [Choice] Debian OS version (use bookworm on local arm64/Apple Silicon): buster, bullseye, bookworm
ARG VARIANT
FROM mcr.microsoft.com/vscode/devcontainers/rust:${VARIANT}

Expand All @@ -10,27 +10,21 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \

RUN apt install -y libgmp3-dev

RUN rustup toolchain install 1.70.0 && \
rustup default 1.70.0 && rustup component add clippy && rustup component add rustfmt
COPY rust-toolchain.toml .

# Install Python
ARG PYTHON_PATH=/usr/local/python
ENV PIPX_HOME=/usr/local/py-utils \
PIPX_BIN_DIR=/usr/local/py-utils/bin
ENV PATH=${PYTHON_PATH}/bin:${PATH}:${PIPX_BIN_DIR}
COPY .devcontainer/library-scripts/python-debian.sh /tmp/library-scripts/
RUN apt-get update && bash /tmp/library-scripts/python-debian.sh "3.9.6" "${PYTHON_PATH}" "${PIPX_HOME}"
# Install cargo-binstall
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash

# Install nodejs
ENV NVM_DIR="/usr/local/share/nvm"
ENV NVM_SYMLINK_CURRENT=true \
PATH=${NVM_DIR}/current/bin:${PATH}
COPY .devcontainer/library-scripts/node-debian.sh /tmp/library-scripts/
RUN apt-get update && bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}"
RUN rustup toolchain install $(cat rust-toolchain.toml | grep channel | cut -d\" -f2) && \
rustup default $(cat rust-toolchain.toml | grep channel | cut -d\" -f2) && \
rustup component add clippy && \
rustup component add rustfmt

RUN cargo binstall cargo-nextest --secure -y

# Install dojoup and scarb for vscode user
USER vscode
RUN curl -L https://install.dojoengine.org | bash
RUN curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | bash

ENV PATH=${PATH}:/workspaces/dojo/target/release
ENV PATH=${PATH}:/workspaces/dojo/target/release:/home/vscode/.dojo/bin
RUN /home/vscode/.dojo/bin/dojoup
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust
{
"name": "Rust",
"image": "ghcr.io/dojoengine/dojo-dev:d7a174c",
"image": "ghcr.io/dojoengine/dojo-dev:a08f2cb",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
test:
runs-on: ubuntu-latest-4-cores
container:
image: ghcr.io/dojoengine/dojo-dev:d7a174c
image: ghcr.io/dojoengine/dojo-dev:a08f2cb
steps:
- uses: actions/checkout@v3
with:
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build-and-push:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-4-cores

env:
DOCKER_TAG: latest
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
run: |
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c 1-7)
echo "DOCKER_TAG=$SHORT_SHA" >> $GITHUB_ENV
- name: Set outputs
id: release_info
run: |
Expand All @@ -55,10 +55,9 @@ jobs:
file: .devcontainer/Dockerfile
tags: ghcr.io/${{ github.repository }}-dev:latest,ghcr.io/${{ github.repository }}-dev:${{ env.DOCKER_TAG }}
build-args: |
VARIANT=bullseye
VARIANT=bookworm
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}-dev:latest
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}-dev:cache

propose-update-pr:
needs: build-and-push
Expand All @@ -70,8 +69,7 @@ jobs:
uses: actions/checkout@v2

- name: Update devcontainer.json
run: |
sed -i "s|ghcr.io/dojoengine/dojo-dev:[a-zA-Z0-9._-]*|ghcr.io/dojoengine/dojo-dev:${{ needs.build-and-push.outputs.tag_name }}|" .devcontainer/devcontainer.json
run: sed -i "s|ghcr.io/dojoengine/dojo-dev:[a-zA-Z0-9._-]*|ghcr.io/dojoengine/dojo-dev:${{ needs.build-and-push.outputs.tag_name }}|" .devcontainer/devcontainer.json

- name: Setup Git credentials
run: |
Expand All @@ -83,14 +81,14 @@ jobs:
git add .devcontainer/devcontainer.json
git commit -m "Update devcontainer image hash: ${{ needs.build-and-push.outputs.tag_name }}"
git checkout -b devcontainer-${{ needs.build-and-push.outputs.tag_name }}
git push --set-upstream origin devcontainer--${{ needs.build-and-push.outputs.tag_name }}
git push --set-upstream origin devcontainer-${{ needs.build-and-push.outputs.tag_name }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Update devcontainer image hash: ${{ needs.build-and-push.outputs.tag_name }}"
commit-message: "Update devcontainer image hash"
branch: update-devcontainer-image-hash
commit-message: "Update devcontainer image hash: ${{ needs.build-and-push.outputs.tag_name }}"
branch: devcontainer-${{ needs.build-and-push.outputs.tag_name }}
base: main
delete-branch: true
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ edition = "2021"
license = "Apache-2.0"
license-file = "LICENSE"
repository = "https://github.com/dojoengine/dojo/"
version = "0.4.0-rc0"
version = "0.4.0-rc1"

[profile.performance]
codegen-units = 1
Expand Down
58 changes: 1 addition & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,60 +67,4 @@ We welcome contributions of all kinds from anyone. See our [Contribution Guide](

## ✏️ Enviroment

See our [Enviroment setup](https://book.dojoengine.org/getting-started/setup.html) for more information.

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tarrencev"><img src="https://avatars.githubusercontent.com/u/4740651?v=4?s=100" width="100px;" alt="Tarrence van As"/><br /><sub><b>Tarrence van As</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=tarrencev" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/enitrat"><img src="https://avatars.githubusercontent.com/u/60658558?v=4?s=100" width="100px;" alt="Mathieu"/><br /><sub><b>Mathieu</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=enitrat" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://shramee.me/"><img src="https://avatars.githubusercontent.com/u/11048263?v=4?s=100" width="100px;" alt="Shramee Srivastav"/><br /><sub><b>Shramee Srivastav</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=shramee" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/omahs"><img src="https://avatars.githubusercontent.com/u/73983677?v=4?s=100" width="100px;" alt="omahs"/><br /><sub><b>omahs</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=omahs" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Larkooo"><img src="https://avatars.githubusercontent.com/u/59736843?v=4?s=100" width="100px;" alt="Larko"/><br /><sub><b>Larko</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=Larkooo" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://bibliothecadao.xyz/"><img src="https://avatars.githubusercontent.com/u/90423308?v=4?s=100" width="100px;" alt="Loaf"/><br /><sub><b>Loaf</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=ponderingdemocritus" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://milancermak.com/"><img src="https://avatars.githubusercontent.com/u/184055?v=4?s=100" width="100px;" alt="Milan Cermak"/><br /><sub><b>Milan Cermak</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=milancermak" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/drspacemn"><img src="https://avatars.githubusercontent.com/u/16685321?v=4?s=100" width="100px;" alt="drspacemn"/><br /><sub><b>drspacemn</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=drspacemn" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/greged93"><img src="https://avatars.githubusercontent.com/u/82421016?v=4?s=100" width="100px;" alt="greged93"/><br /><sub><b>greged93</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=greged93" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/JunichiSugiura"><img src="https://avatars.githubusercontent.com/u/8398372?v=4?s=100" width="100px;" alt="Junichi Sugiura"/><br /><sub><b>Junichi Sugiura</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=JunichiSugiura" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Cheelax"><img src="https://avatars.githubusercontent.com/u/18716884?v=4?s=100" width="100px;" alt="Thomas Belloc"/><br /><sub><b>Thomas Belloc</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=Cheelax" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/broody"><img src="https://avatars.githubusercontent.com/u/610224?v=4?s=100" width="100px;" alt="Yun"/><br /><sub><b>Yun</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=broody" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kariy"><img src="https://avatars.githubusercontent.com/u/26515232?v=4?s=100" width="100px;" alt="Ammar Arif"/><br /><sub><b>Ammar Arif</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=kariy" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ftupas"><img src="https://avatars.githubusercontent.com/u/35031356?v=4?s=100" width="100px;" alt="ftupas"/><br /><sub><b>ftupas</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=ftupas" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/whatthedev-eth"><img src="https://avatars.githubusercontent.com/u/93558031?v=4?s=100" width="100px;" alt="whatthedev.eth"/><br /><sub><b>whatthedev.eth</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=whatthedev-eth" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aymericdelab"><img src="https://avatars.githubusercontent.com/u/38816784?v=4?s=100" width="100px;" alt="raschel"/><br /><sub><b>raschel</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=aymericdelab" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sparqet"><img src="https://avatars.githubusercontent.com/u/37338401?v=4?s=100" width="100px;" alt="sparqet"/><br /><sub><b>sparqet</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=sparqet" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rkdud007"><img src="https://avatars.githubusercontent.com/u/76558220?v=4?s=100" width="100px;" alt="Pia"/><br /><sub><b>Pia</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=rkdud007" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bingcicle"><img src="https://avatars.githubusercontent.com/u/25565268?v=4?s=100" width="100px;" alt="bing"/><br /><sub><b>bing</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=bingcicle" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ptisserand"><img src="https://avatars.githubusercontent.com/u/544314?v=4?s=100" width="100px;" alt="ptisserand"/><br /><sub><b>ptisserand</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=ptisserand" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/glihm"><img src="https://avatars.githubusercontent.com/u/7962849?v=4?s=100" width="100px;" alt="glihm"/><br /><sub><b>glihm</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=glihm" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/coostendorp"><img src="https://avatars.githubusercontent.com/u/4388195?v=4?s=100" width="100px;" alt="Caspar Oostendorp"/><br /><sub><b>Caspar Oostendorp</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=coostendorp" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xJonathanLEI"><img src="https://avatars.githubusercontent.com/u/19556359?v=4?s=100" width="100px;" alt="Jonathan LEI"/><br /><sub><b>Jonathan LEI</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=xJonathanLEI" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/neotheprogramist"><img src="https://avatars.githubusercontent.com/u/128649481?v=4?s=100" width="100px;" alt="Paweł"/><br /><sub><b>Paweł</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=neotheprogramist" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lambda-0x"><img src="https://avatars.githubusercontent.com/u/87354252?v=4?s=100" width="100px;" alt="lambda-0x"/><br /><sub><b>lambda-0x</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=lambda-0x" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bajpai244"><img src="https://avatars.githubusercontent.com/u/41180869?v=4?s=100" width="100px;" alt="Harsh Bajpai"/><br /><sub><b>Harsh Bajpai</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=bajpai244" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jobez"><img src="https://avatars.githubusercontent.com/u/615197?v=4?s=100" width="100px;" alt="johann bestowrous"/><br /><sub><b>johann bestowrous</b></sub></a><br /><a href="https://github.com/dojoengine/dojo/commits?author=jobez" title="Code">💻</a></td>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the
[all-contributors](https://github.com/all-contributors/all-contributors)
specification. Contributions of any kind welcome!
See our [Enviroment setup](https://book.dojoengine.org/getting-started/setup.html) for more information.
2 changes: 1 addition & 1 deletion crates/dojo-core/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version = 1

[[package]]
name = "dojo"
version = "0.4.0-rc0"
version = "0.4.0-rc1"
dependencies = [
"dojo_plugin",
]
Expand Down
Loading

0 comments on commit 4d441bf

Please sign in to comment.