Skip to content

Commit

Permalink
feat/templates: use cargo overwrites and split container resources
Browse files Browse the repository at this point in the history
Split into preload and non-preload, since the preloads are only used by
the juice-container pipeline and cause unused resource errors otherwise.
  • Loading branch information
drahnr committed Mar 26, 2018
1 parent 0b87188 commit 81f968d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 21 deletions.
21 changes: 21 additions & 0 deletions templates/cargo-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

function toml_path_array {
local pre="[\""
local post="\"]"
local first=${1}
local d='","'
shift
echo -n "${pre}"
echo -n "${first}"
printf "%s" "${@/#/$d}";
echo -n "${post}"
}


function sanitize_paths {
for item in ${*}; do
dirname $(realpath ${item})
done
}

toml_path_array $(sanitize_paths $(fd --absolute-path Cargo.toml ../..))
21 changes: 21 additions & 0 deletions templates/container-resources-preload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

- name: container-fedora
type: docker-image
source:
repository: fedora
max_concurrent_downloads: 1
max_concurrent_uploads: 1

- name: fedora-preload
type: docker-image
source:
repository: fedora
max_concurrent_downloads: 2
max_concurrent_uploads: 1

- name: ubuntu-preload
type: docker-image
source:
repository: ubuntu
max_concurrent_downloads: 2
max_concurrent_uploads: 1
21 changes: 0 additions & 21 deletions templates/container-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,3 @@
max_concurrent_downloads: 2
max_concurrent_uploads: 2

- name: container-fedora
type: docker-image
source:
repository: fedora
max_concurrent_downloads: 1
max_concurrent_uploads: 1

- name: fedora-preload
type: docker-image
source:
repository: fedora
max_concurrent_downloads: 2
max_concurrent_uploads: 1

- name: ubuntu-preload
type: docker-image
source:
repository: ubuntu
max_concurrent_downloads: 2
max_concurrent_uploads: 1

1 change: 1 addition & 0 deletions templates/juice-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
uri: https://github.com/spearow/continuous-integration.git

{% include "container-resources.yml" %}
{% include "container-resources-preload.yml" %}

jobs:
- name: build-misc
Expand Down
5 changes: 5 additions & 0 deletions templates/juice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ jobs:
args:
- -exc
- |
{% include "cargo-config.yml" %}
{% include "cargo.yml" %}
dir: {{ which }}coaster
{% endfor %}
Expand Down Expand Up @@ -612,6 +613,7 @@ jobs:
args:
- -exc
- |
{% include "cargo-config.yml" -%}
{% include "cargo.yml" %}
dir: {{ which }}coaster-nn
{% endfor %}
Expand Down Expand Up @@ -665,6 +667,7 @@ jobs:
args:
- -exc
- |
{% include "cargo-config.yml" -%}
{% include "cargo.yml" %}
dir: {{ which }}greenglas
{% endfor %}
Expand Down Expand Up @@ -719,6 +722,7 @@ jobs:
args:
- -exc
- |
{% include "cargo-config.yml" -%}
{% include "cargo.yml" %}
dir: {{ which }}juice
{% endfor %}
Expand Down Expand Up @@ -776,6 +780,7 @@ jobs:
args:
- -exc
- |
{% include "cargo-config.yml" -%}
{% include "cargo.yml" %}
dir: {{ which }}juice-examples
{% endfor %}
Expand Down

0 comments on commit 81f968d

Please sign in to comment.