forked from ipython/ipyparallel
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (43 loc) · 2.15 KB
/
test-jo.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
name: win-docker
on:
workflow_dispatch:
jobs:
win-setup:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
#- name: Check Hyper-V and Docker
# run: |
# Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
# docker version
# docker images
- name: Compose win-sshd docker containter
run: |
# compose docker container
cd ci/ssh-win
docker compose up -d --build
# retrieve id_rsa file for public key authentication
mkdir $env:USERPROFILE/.ssh/
docker run ipyparallel-sshd powershell.exe -Command "type C:\Users\ciuser\.ssh\id_rsa" | out-file -encoding ascii $env:USERPROFILE/.ssh/id_rsa
- name: ssh connection and copy files
run: |
# make first ssh connection to docker container (requires StrictHostKeyChecking set to no ) and create dir
# verbose: remove -v parameter for less output messages
ssh -o "StrictHostKeyChecking no" ciuser@localhost -p 2222 -v mkdir c:\src\ipyparallel
# zip ipyparallel files (excluding file might not be needed)
$exclude = @("__pycache__","node_modules")
$files = Get-ChildItem -Path "." -Exclude $exclude
Compress-Archive -Path $files -DestinationPath ipyparallel.zip -CompressionLevel Fastest
# copy file into docker (we need to do it over ssh since docker copy or mount doesn't work in Hyper-V)
scp -P 2222 ipyparallel.zip ciuser@localhost:c:\src\ipyparallel
# deflate ipyparallel files
ssh ciuser@localhost -p 2222 powershell.exe -Command "Expand-Archive -Path c:\src\ipyparallel\ipyparallel.zip -DestinationPath c:\src\ipyparallel"
# pip install ipyparallel files
ssh ciuser@localhost -p 2222 dir c:\src\ipyparallel
ssh ciuser@localhost -p 2222 "cd c:\src\ipyparallel && pip install -e ."
- name: test ipyparallel
run: |
# check environment
ssh ciuser@localhost -p 2222 pip freeze
# send test command
ssh ciuser@localhost -p 2222 ipcluster -h