Skip to content

Commit 943cf58

Browse files
authored
Merge pull request #88 from bcbi/dpa/refactor-api
Refactor the API to make it more reusable
2 parents 0675135 + 4d92ddf commit 943cf58

23 files changed

Lines changed: 609 additions & 424 deletions

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
version:
18+
- '1.4'
1819
- '1'
1920
- 'nightly'
2021
os:
@@ -31,3 +32,7 @@ jobs:
3132
- uses: julia-actions/julia-runtest@latest
3233
env:
3334
SIMPLECONTAINERGENERATOR_TESTS: 'all'
35+
- uses: julia-actions/julia-processcoverage@v1
36+
- uses: codecov/codecov-action@v1
37+
with:
38+
file: lcov.info

.github/workflows/predictmd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PredictMD
1+
name: PredictMD_docker
22
on:
33
pull_request:
44
push:
@@ -10,7 +10,7 @@ on:
1010
- cron: '00 00,12 * * *'
1111

1212
jobs:
13-
PredictMD:
13+
PredictMD_docker:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
@@ -28,7 +28,7 @@ jobs:
2828
arch: ${{ matrix.arch }}
2929
- uses: julia-actions/julia-buildpkg@latest
3030
- uses: julia-actions/julia-runtest@latest
31-
- run: julia --project -e 'import SimpleContainerGenerator; pkgs = [(name = "PredictMD", rev = "master", ), (name = "PredictMDExtra", rev = "master", ), (name = "PredictMDFull", rev = "master", ), (name = "UnicodePlots", version = "1.2.0 - *", ),]; no_test = String["UnicodePlots"]; parent_image = "nvidia/cuda"; SimpleContainerGenerator.create_dockerfile(pkgs; no_test = no_test, parent_image = parent_image)'
31+
- run: julia --project -e 'import SimpleContainerGenerator; pkgs = [(name = "PredictMD", rev = "master", ), (name = "PredictMDExtra", rev = "master", ), (name = "PredictMDFull", rev = "master", ), (name = "UnicodePlots", version = "1.2.0 - *", ),]; no_test = String["UnicodePlots"]; parent_image = "nvidia/cuda"; tests_must_pass = String["PredictMD", "PredictMDExtra", "PredictMDFull"]; SimpleContainerGenerator.create_dockerfile(pkgs; no_test = no_test, parent_image = parent_image, tests_must_pass = tests_must_pass)'
3232
- if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule')
3333
env:
3434
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}

.travis.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SimpleContainerGenerator"
22
uuid = "b8d349fb-717b-4aac-a9b1-e1da4219c631"
33
authors = ["Dilum Aluthge"]
4-
version = "1.3.0"
4+
version = "2.0.0-DEV"
55

66
[deps]
77
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"

README.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SimpleContainerGenerator
22

3-
[![Build Status](https://travis-ci.com/bcbi/SimpleContainerGenerator.jl.svg?branch=master)](https://travis-ci.com/bcbi/SimpleContainerGenerator.jl/branches)
4-
[![Codecov](https://codecov.io/gh/bcbi/SimpleContainerGenerator.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/bcbi/SimpleContainerGenerator.jl)
3+
[![Build Status](https://github.com/bcbi/SimpleContainerGenerator.jl/workflows/CI/badge.svg)](https://github.com/bcbi/SimpleContainerGenerator.jl/actions)
4+
[![Coverage](https://codecov.io/gh/bcbi/SimpleContainerGenerator.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/bcbi/SimpleContainerGenerator.jl)
55

66
SimpleContainerGenerator automates the process of creating container images for using Julia packages.
77

@@ -20,6 +20,8 @@ Pkg.add("SimpleContainerGenerator")
2020

2121
## Examples
2222

23+
In order to run these examples, you will need to have Docker installed on your computer.
24+
2325
### Example 1
2426

2527
```julia
@@ -35,9 +37,9 @@ pkgs = [
3537
]
3638
julia_version = v"1.4.0"
3739

38-
SimpleContainerGenerator.create_dockerfile(pkgs,
39-
pwd();
40-
julia_version = julia_version)
40+
SimpleContainerGenerator.create_dockerfile(pkgs;
41+
julia_version = julia_version,
42+
output_directory = pwd())
4143

4244
run(`docker build -t my_docker_username/my_image_name .`)
4345
```
@@ -57,9 +59,9 @@ pkgs = [
5759
]
5860
julia_version = v"1.4.0"
5961

60-
SimpleContainerGenerator.create_dockerfile(pkgs,
61-
pwd();
62-
julia_version = julia_version)
62+
SimpleContainerGenerator.create_dockerfile(pkgs;
63+
julia_version = julia_version,
64+
output_directory = pwd())
6365

6466
run(`docker build -t my_docker_username/my_image_name .`)
6567
```
@@ -79,9 +81,9 @@ pkgs = [
7981
]
8082
julia_version = v"1.4.0"
8183

82-
SimpleContainerGenerator.create_dockerfile(pkgs,
83-
pwd();
84-
julia_version = julia_version)
84+
SimpleContainerGenerator.create_dockerfile(pkgs;
85+
julia_version = julia_version,
86+
output_directory = pwd())
8587

8688
run(`docker build -t my_docker_username/my_image_name .`)
8789
```
@@ -101,9 +103,9 @@ pkgs = [
101103
]
102104
julia_version = v"1.4.0"
103105

104-
SimpleContainerGenerator.create_dockerfile(pkgs,
105-
pwd();
106-
julia_version = julia_version)
106+
SimpleContainerGenerator.create_dockerfile(pkgs;
107+
julia_version = julia_version,
108+
output_directory = pwd())
107109

108110
run(`docker build -t my_docker_username/my_image_name .`)
109111
```
@@ -129,11 +131,11 @@ exclude_packages_from_sysimage = [
129131
]
130132
julia_version = v"1.4.0"
131133

132-
SimpleContainerGenerator.create_dockerfile(pkgs,
133-
pwd();
134+
SimpleContainerGenerator.create_dockerfile(pkgs;
134135
julia_version = julia_version,
135136
no_test = no_test,
136-
exclude_packages_from_sysimage = exclude_packages_from_sysimage)
137+
exclude_packages_from_sysimage = exclude_packages_from_sysimage,
138+
output_directory = pwd())
137139

138140
run(`docker build -t my_docker_username/my_image_name .`)
139141
```
@@ -154,9 +156,9 @@ pkgs = [
154156
julia_version = v"1.4.0"
155157
parent_image = "ubuntu:latest"
156158

157-
SimpleContainerGenerator.create_dockerfile(pkgs,
158-
pwd();
159+
SimpleContainerGenerator.create_dockerfile(pkgs;
159160
julia_version = julia_version,
161+
output_directory = pwd(),
160162
parent_image = parent_image)
161163

162164
run(`docker build -t my_docker_username/my_image_name .`)
@@ -178,9 +180,9 @@ pkgs = [
178180
julia_version = v"1.4.0"
179181
parent_image = "nvidia/cuda:latest"
180182

181-
SimpleContainerGenerator.create_dockerfile(pkgs,
182-
pwd();
183+
SimpleContainerGenerator.create_dockerfile(pkgs;
183184
julia_version = julia_version,
185+
output_directory = pwd(),
184186
parent_image = parent_image)
185187

186188
run(`docker build -t my_docker_username/my_image_name .`)
@@ -203,4 +205,4 @@ run(`docker build -t my_docker_username/my_image_name .`)
203205

204206
## Acknowledgements
205207

206-
- This work was supported in part by National Institutes of Health grants U54GM115677, R01LM011963, and R25MH116440. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.
208+
- This work was supported in part by National Institutes of Health grants R01LM011963, R25MH116440, and U54GM115677 and National Science Foundation award 2027892. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health or the National Science Foundation.

src/SimpleContainerGenerator.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import PackageCompiler
44
import Pkg
55
import UUIDs
66

7+
include("types_config.jl")
78
include("types.jl")
89

910
include("public.jl")
10-
1111
include("public_create_dockerfile.jl")
1212

1313
include("assert.jl")
1414
include("backups_of_simplecontainergenerator.jl")
15+
include("config_to_template.jl")
1516
include("default_values.jl")
1617
include("docker.jl")
1718
include("generate_helper_files.jl")
@@ -20,6 +21,7 @@ include("generate_packagecompiler_install.jl")
2021
include("generate_packagecompiler_run.jl")
2122
include("generate_precompile_execution.jl")
2223
include("julia.jl")
24+
include("pkg_dir.jl")
2325
include("utils.jl")
2426

2527
end # module

src/assert.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@inline function always_assert(condition::Bool,
1+
function always_assert(condition::Bool,
22
msg::String)
33
if !condition
44
throw(AlwaysAssertionError(msg))

src/backups_of_simplecontainergenerator.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@inline function _generate_backupsofsimplecontainergenerator_content_1(config::Config)
1+
function _generate_backupsofsimplecontainergenerator_content_1(config::Config)
22
simplecontainergenerator_installation_command = config.simplecontainergenerator_installation_command
33
lines = String[
44
"empty!(Base.DEPOT_PATH)",
@@ -10,7 +10,7 @@
1010
return content
1111
end
1212

13-
@inline function _generate_backupsofsimplecontainergenerator_content_2(config::Config)
13+
function _generate_backupsofsimplecontainergenerator_content_2(config::Config)
1414
packagecompiler_installation_command = config.packagecompiler_installation_command
1515
lines = String[
1616
"empty!(Base.DEPOT_PATH)",

0 commit comments

Comments
 (0)