Skip to content

Commit a447591

Browse files
authored
Merge pull request #29 from Iainmon/iain-changes
More CI changes
2 parents e863636 + 76867a7 commit a447591

11 files changed

Lines changed: 230 additions & 1 deletion

File tree

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Container image that runs your code
2+
# FROM ubuntu:latest
3+
# FROM pytorch/pytorch:latest
4+
5+
FROM chapel/chapel
6+
# as chapel
7+
8+
# WORKDIR /ChAI
9+
10+
# COPY ../../. /ChAI/
11+
12+
# RUN echo $(ls -la)
13+
# RUN echo $(ls -la /)
14+
# RUN echo $(ls -la /ChAI)
15+
16+
# Install pytorch
17+
# RUN pip3 install torch numpy torch
18+
19+
# PLEASE SEE {ChAI}/docker/chapel-pytorch-test/.!
20+
21+
22+
23+
24+
#
25+
#
26+
#
27+
#
28+
#
29+
# See docker/chapel-pytorch-test and examine it closely!
30+
#
31+
#
32+
#
33+
#
34+
#
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
# RUN echo $(which python3)
60+
# RUN echo $(which chpl)
61+
62+
# RUN echo $(ls -la)
63+
64+
# WORKDIR /ChAI
65+
66+
# RUN echo $(ls -la)
67+
68+
# COPY . .
69+
70+
# RUN chpl test/correspondence/construction/ones/ones.chpl -M lib -o test/correspondence/construction/ones/ones
71+
# RUN chpl test/correspondence/construction/arange/arange.chpl -M lib -o test/correspondence/construction/arange/arange
72+
73+
74+
# RUN echo $(ls -la)
75+
76+
# COPY entrypoint.sh ./entrypoint.sh
77+
# COPY ../../../ ./
78+
79+
# RUN echo $(ls -la)
80+
81+
82+
# Copies your code file from your action repository to the filesystem path `/` of the container
83+
# COPY entrypoint.sh /entrypoint.sh
84+
85+
# RUN chmod +x ./entrypoint.sh
86+
87+
# RUN echo $(which chpl || echo "bad chapel. ")
88+
89+
# RUN ./entrypoint.sh
90+
91+
92+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
93+
# ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: 'Hello World'
2+
description: 'Greet someone and record the time'
3+
inputs:
4+
who-to-greet: # id of input
5+
description: 'Who to greet'
6+
required: true
7+
default: 'World'
8+
outputs:
9+
time: # id of output
10+
description: 'The time we greeted you'
11+
runs:
12+
using: 'docker'
13+
image: 'Dockerfile'
14+
args:
15+
- ${{ inputs.who-to-greet }}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/sh -l
2+
3+
echo "Hello $1"
4+
time=$(date)
5+
echo "time=$time" >> $GITHUB_OUTPUT
6+
7+
stdout=$(which python3)
8+
echo "python3=$stdout" >> $GITHUB_OUTPUT
9+
10+
stdout=$(which chpl)
11+
echo "chapel=$stdout" >> $GITHUB_OUTPUT
12+
13+
14+
15+
16+
17+
echo "Begin test attempt. "
18+
stdout=$(ls -la)
19+
echo "$stdout"
20+
21+
echo "Running tests."
22+
23+
echo "Trying to compile test from entrypoint.sh. "
24+
chpl test/correspondence/construction/ones/ones.chpl -M lib -o test/correspondence/construction/ones/ones
25+
chpl test/correspondence/construction/arange/arange.chpl -M lib -o test/correspondence/construction/arange/arange
26+
27+
echo "Now running correspondence test. "
28+
echo $(cd test/correspondence && python3 correspondence.py)
29+
30+
echo "End test attempt. "
31+
32+
33+
34+
echo $(pwd)
35+
36+
echo $(which python3 || echo "No python3")
37+
echo $(which chpl || echo "No chpl")
38+
39+
40+
echo $(cd / && ls)
41+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test Docker Image Action (Hello Action)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
10+
jobs:
11+
hello_world_job:
12+
runs-on: ubuntu-latest
13+
name: A job to say hello
14+
steps:
15+
# To use this repository's private action,
16+
# you must check out the repository
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Hello world action step
21+
uses: ./.github/actions/hello-action # Uses an action in the root directory
22+
id: hello
23+
with:
24+
who-to-greet: 'Mona the Octocat'
25+
26+
# # Use the output from the `hello` step
27+
# # echo "The time was ${{ steps.hello.outputs.time }}"
28+
# # (echo "The python3 path is ${{ steps.hello.outputs.python3 }}" || echo "No python3 found!")
29+
# # (echo "The chapel path is ${{ steps.hello.outputs.chapel }}" || echo "No chapel found!")
30+
31+
# - name: Get the output time
32+
# run: |
33+
# echo "All outputs: ${{ steps.hello.outputs }}"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ target/
1717
.cls-commands.json
1818
.venv
1919
__pycache__/
20+
!Dockerfile
21+
node_modules/

docker/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM chapel/chapel:latest
2+
3+
# Install Python 3, pip, NumPy, Torch
4+
RUN apt-get update \
5+
&& apt-get install -y --no-install-recommends python3 python3-pip \
6+
&& pip3 install --no-cache-dir numpy torch \
7+
&& apt-get clean \
8+
&& rm -rf /var/lib/apt/lists/*
9+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM chapel/chapel
2+
3+
# Install pytorch
4+
RUN pip3 install torch
5+
6+
# RUN echo "Hello!"
7+
# RUN echo $(which chpl)
8+
9+
# ADD ./script.sh ./script.sh
10+
11+
WORKDIR /app
12+
13+
COPY ./script.sh script.sh
14+
COPY . ../../.
15+
RUN sh script.sh
16+
17+
# CMD ["sh","script.sh"] # Turn off when testing.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
docker build --tag 'chapel_pytorch_test' .
4+
docker run -a STDOUT -a STDERR 'chapel_pytorch_test'
5+
6+
# terminal cmd: sh build-run.sh && docker run -it 'chapel_pytorch_test'
7+
# when testing and output of Dockerfile could be unreliable. Having
8+
# this allows you to see the environment produced by the Dockerfile!
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Hello!"
4+
5+
echo $(which chpl)
6+
7+
echo $(which python3 || echo "No 'python3' found!")

myshell.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
echo $(pwd)

0 commit comments

Comments
 (0)