-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from Iainmon/iain-changes
More CI changes
- Loading branch information
Showing
11 changed files
with
230 additions
and
1 deletion.
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,93 @@ | ||
# Container image that runs your code | ||
# FROM ubuntu:latest | ||
# FROM pytorch/pytorch:latest | ||
|
||
FROM chapel/chapel | ||
# as chapel | ||
|
||
# WORKDIR /ChAI | ||
|
||
# COPY ../../. /ChAI/ | ||
|
||
# RUN echo $(ls -la) | ||
# RUN echo $(ls -la /) | ||
# RUN echo $(ls -la /ChAI) | ||
|
||
# Install pytorch | ||
# RUN pip3 install torch numpy torch | ||
|
||
# PLEASE SEE {ChAI}/docker/chapel-pytorch-test/.! | ||
|
||
|
||
|
||
|
||
# | ||
# | ||
# | ||
# | ||
# | ||
# See docker/chapel-pytorch-test and examine it closely! | ||
# | ||
# | ||
# | ||
# | ||
# | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# RUN echo $(which python3) | ||
# RUN echo $(which chpl) | ||
|
||
# RUN echo $(ls -la) | ||
|
||
# WORKDIR /ChAI | ||
|
||
# RUN echo $(ls -la) | ||
|
||
# COPY . . | ||
|
||
# RUN chpl test/correspondence/construction/ones/ones.chpl -M lib -o test/correspondence/construction/ones/ones | ||
# RUN chpl test/correspondence/construction/arange/arange.chpl -M lib -o test/correspondence/construction/arange/arange | ||
|
||
|
||
# RUN echo $(ls -la) | ||
|
||
# COPY entrypoint.sh ./entrypoint.sh | ||
# COPY ../../../ ./ | ||
|
||
# RUN echo $(ls -la) | ||
|
||
|
||
# Copies your code file from your action repository to the filesystem path `/` of the container | ||
# COPY entrypoint.sh /entrypoint.sh | ||
|
||
# RUN chmod +x ./entrypoint.sh | ||
|
||
# RUN echo $(which chpl || echo "bad chapel. ") | ||
|
||
# RUN ./entrypoint.sh | ||
|
||
|
||
# Code file to execute when the docker container starts up (`entrypoint.sh`) | ||
# ENTRYPOINT ["/entrypoint.sh"] |
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,15 @@ | ||
name: 'Hello World' | ||
description: 'Greet someone and record the time' | ||
inputs: | ||
who-to-greet: # id of input | ||
description: 'Who to greet' | ||
required: true | ||
default: 'World' | ||
outputs: | ||
time: # id of output | ||
description: 'The time we greeted you' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.who-to-greet }} |
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,41 @@ | ||
#!/bin/sh -l | ||
|
||
echo "Hello $1" | ||
time=$(date) | ||
echo "time=$time" >> $GITHUB_OUTPUT | ||
|
||
stdout=$(which python3) | ||
echo "python3=$stdout" >> $GITHUB_OUTPUT | ||
|
||
stdout=$(which chpl) | ||
echo "chapel=$stdout" >> $GITHUB_OUTPUT | ||
|
||
|
||
|
||
|
||
|
||
echo "Begin test attempt. " | ||
stdout=$(ls -la) | ||
echo "$stdout" | ||
|
||
echo "Running tests." | ||
|
||
echo "Trying to compile test from entrypoint.sh. " | ||
chpl test/correspondence/construction/ones/ones.chpl -M lib -o test/correspondence/construction/ones/ones | ||
chpl test/correspondence/construction/arange/arange.chpl -M lib -o test/correspondence/construction/arange/arange | ||
|
||
echo "Now running correspondence test. " | ||
echo $(cd test/correspondence && python3 correspondence.py) | ||
|
||
echo "End test attempt. " | ||
|
||
|
||
|
||
echo $(pwd) | ||
|
||
echo $(which python3 || echo "No python3") | ||
echo $(which chpl || echo "No chpl") | ||
|
||
|
||
echo $(cd / && ls) | ||
|
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,33 @@ | ||
name: Test Docker Image Action (Hello Action) | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
|
||
jobs: | ||
hello_world_job: | ||
runs-on: ubuntu-latest | ||
name: A job to say hello | ||
steps: | ||
# To use this repository's private action, | ||
# you must check out the repository | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Hello world action step | ||
uses: ./.github/actions/hello-action # Uses an action in the root directory | ||
id: hello | ||
with: | ||
who-to-greet: 'Mona the Octocat' | ||
|
||
# # Use the output from the `hello` step | ||
# # echo "The time was ${{ steps.hello.outputs.time }}" | ||
# # (echo "The python3 path is ${{ steps.hello.outputs.python3 }}" || echo "No python3 found!") | ||
# # (echo "The chapel path is ${{ steps.hello.outputs.chapel }}" || echo "No chapel found!") | ||
|
||
# - name: Get the output time | ||
# run: | | ||
# echo "All outputs: ${{ steps.hello.outputs }}" |
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 |
---|---|---|
|
@@ -17,3 +17,5 @@ target/ | |
.cls-commands.json | ||
.venv | ||
__pycache__/ | ||
!Dockerfile | ||
node_modules/ |
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,9 @@ | ||
FROM chapel/chapel:latest | ||
|
||
# Install Python 3, pip, NumPy, Torch | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends python3 python3-pip \ | ||
&& pip3 install --no-cache-dir numpy torch \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
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,17 @@ | ||
FROM chapel/chapel | ||
|
||
# Install pytorch | ||
RUN pip3 install torch | ||
|
||
# RUN echo "Hello!" | ||
# RUN echo $(which chpl) | ||
|
||
# ADD ./script.sh ./script.sh | ||
|
||
WORKDIR /app | ||
|
||
COPY ./script.sh script.sh | ||
COPY . ../../. | ||
RUN sh script.sh | ||
|
||
# CMD ["sh","script.sh"] # Turn off when testing. |
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker build --tag 'chapel_pytorch_test' . | ||
docker run -a STDOUT -a STDERR 'chapel_pytorch_test' | ||
|
||
# terminal cmd: sh build-run.sh && docker run -it 'chapel_pytorch_test' | ||
# when testing and output of Dockerfile could be unreliable. Having | ||
# this allows you to see the environment produced by the Dockerfile! |
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,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Hello!" | ||
|
||
echo $(which chpl) | ||
|
||
echo $(which python3 || echo "No 'python3' found!") |
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,3 @@ | ||
|
||
|
||
echo $(pwd) |
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