Skip to content

Commit

Permalink
feat: first try it
Browse files Browse the repository at this point in the history
  • Loading branch information
supersonictw committed Nov 18, 2023
1 parent 47982fa commit d303a47
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create and publish a Docker image

on:
push:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM debian:bookworm-slim

ADD build /build

WORKDIR /build
RUN bash dpkg.sh
RUN bash rocm.sh
RUN bash ipython.sh

#RUN rm -rf /build

WORKDIR /root
CMD ["/usr/local/bin/ipython"]
10 changes: 10 additions & 0 deletions build/dpkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e

apt-get -qq update
apt-get -qq install -y --no-install-recommends wget ca-certificates

wget -qO /etc/apt/sources.list https://gist.githubusercontent.com/supersonictw/46f2da8114d620168c674fa8e104d1f0/raw/e4736ca846a1ebbc22ee47bc1d0676ced3604e0c/sources.debian.list
apt-get -qq update
apt-get -qq upgrade
6 changes: 6 additions & 0 deletions build/ipython.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

set -e

apt install -y --no-recommended python3 python3-pip python-is-python3
pip install ipython
24 changes: 24 additions & 0 deletions build/rocm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

set -e

# install script dependencies
apt-get -qq install build-essential cmake repo git

# repo sync
repo init -u https://github.com/RadeonOpenCompute/ROCm.git -b roc-5.7.x
repo sync

# prepare rocm-build
git clone https://github.com/xuhuisheng/rocm-build.git --branch 59b87dc62972c1ad32a8862e9ea6b5921c1f33a0
cd rocm-build && source env.sh && sh install-dependency.sh

# Array of script names matching the pattern [0-9][0-9].?????.sh
scripts=($(ls -1v [0-9][0-9].*.sh))

# Loop through scripts and execute them
for script in "${scripts[@]}"; do
echo "Running script: $script"
bash "$script"
echo "----------------------------------------"
done

0 comments on commit d303a47

Please sign in to comment.