Skip to content

Commit 6009593

Browse files
committed
Merge branch 'development' into release
2 parents 0a52f25 + 261ed1a commit 6009593

File tree

9 files changed

+74
-45
lines changed

9 files changed

+74
-45
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33

44
## Container targets
55
full-container:
6-
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=full playbook=provision_virtualmicromagnetics_full.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/"
6+
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=full playbook=provision_virtualmicromagnetics_full.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/ container_push=false"
77

88
lite-container:
9-
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=lite playbook=provision_virtualmicromagnetics_lite.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/"
9+
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=lite playbook=provision_virtualmicromagnetics_lite.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/ container_push=false"
1010

1111
oommf-container:
12-
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=oommf playbook=provision_virtualmicromagnetics_oommf.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/"
12+
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=oommf playbook=provision_virtualmicromagnetics_oommf.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/ container_push=false"
1313

1414
magpar-container:
15-
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=magpar playbook=provision_virtualmicromagnetics_magpar.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/"
15+
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=magpar playbook=provision_virtualmicromagnetics_magpar.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/ container_push=false"
1616

1717
nmag-container:
18-
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=nmag playbook=provision_virtualmicromagnetics_nmag.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/"
18+
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=nmag playbook=provision_virtualmicromagnetics_nmag.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/ container_push=false"
1919

2020
fidimag-container:
21-
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=fidimag playbook=provision_virtualmicromagnetics_fidimag.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/"
21+
ansible-playbook master.yml -c local -i localhost, -v -k --extra-vars="type=container container_name=fidimag playbook=provision_virtualmicromagnetics_fidimag.yml hookbook=hook_container.yml extra_resources_dir=guest_resources/ container_push=false"
2222

2323
## VM targets
2424
full-vm: full

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
# built documents.
6161
#
6262
# The short X.Y version.
63-
version = u'1.0.4'
63+
version = u'1.1.0'
6464
# The full version, including alpha/beta/rc tags.
65-
release = u'1.0.4'
65+
release = u'1.1.0'
6666

6767
# The language for content autogenerated by Sphinx. Refer to documentation
6868
# for a list of supported languages.

docs/developer-notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _dev-notes:
22

3-
Developer Notes (valid for version 1.0.4)
3+
Developer Notes (valid for version 1.1.0)
44
=========================================
55

66
In :ref:`getting-started-poweruser`, we created a virtual environment from

docs/getting-started-user.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Your user will need to be in the docker group on the machine you are running on
4848
[#]_. After restarting your machine, command the following in an empty
4949
directory::
5050

51-
docker run -ti virtualmicromagnetics/full:release /bin/bash
51+
docker run -ti virtualmicromagnetics/lite:1.1.0 /bin/bash -l
5252

5353
This command will download the Full Virtual Micromagnetics container image from
5454
the Internet to your computer, and start bash in your shell.
@@ -58,5 +58,5 @@ besides the Full Virtual Micromagnetics environment.
5858

5959
.. [#] Note that the docker group is root-equivalent, so you will likely need
6060
to own the machine to use Virtual Micromagnetics containers. To avoid this,
61-
consider using a different provider that does not require root priveleges,
61+
consider using a different provider that does not require root privileges,
6262
but beware, as Docker is the only container provider supported at present.

jobs/hook_container.yml

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,50 +13,75 @@
1313
name={{ artefact_dir }}
1414
state=directory
1515

16-
- name: Obtain the current tag, (or version if untagged) of this repository.
17-
shell: |
18-
TAG=$(git name-rev --tags --name-only HEAD | cut -f1 -d^)
19-
if [ "$(echo $TAG | tr -d [:space:])" == "undefined" ]; then
20-
git rev-parse --short HEAD
21-
else
22-
echo $TAG
23-
fi
16+
- name: Obtain current tag of this repository, if any.
17+
shell: git name-rev --tags --name-only HEAD | cut -f1 -d^
2418
args:
2519
chdir: "{{ container_dir }}"
2620
executable: /bin/bash
27-
register: current_version
21+
register: tag
2822

29-
- name: Set artefact name.
23+
- name: Obtain current version hash of this repository.
24+
shell: git rev-parse --short HEAD
25+
args:
26+
chdir: "{{ container_dir }}"
27+
executable: /bin/bash
28+
register: version
29+
30+
# Alternatively, we can obtain the branch in detached-head state using the
31+
# environment variable GIT_BRANCH if it is set. This helps out Jenkins.
32+
- name: Obtain current branch of this repository.
33+
shell: if [ -z "$GIT_BRANCH" ]; then git symbolic-ref HEAD | grep -o [^/]*$; else echo "$GIT_BRANCH" | grep -o [^/][a-zA-Z0-9-]*$; fi
34+
args:
35+
chdir: "{{ container_dir }}"
36+
executable: /bin/bash
37+
register: branch
38+
39+
# Exporting container filesystem as tarball.
40+
41+
- name: Set artefact name with tag, if we could find one.
42+
set_fact:
43+
artefact_name: "{{ container_name }}_{{ tag.stdout }}.tar"
44+
when: tag.stdout != "undefined"
45+
46+
- name: Set artefact name with version hash, if we could not find a tag.
3047
set_fact:
31-
artefact_name: "{{ container_name }}_{{ current_version.stdout }}.tar"
48+
artefact_name: "{{ container_name }}_{{ version.stdout }}.tar"
49+
when: tag.stdout == "undefined"
3250

3351
- name: Export the container filesystem as an artefact.
3452
command: docker export --output={{ artefact_dir }}{{ artefact_name }} {{ container_name }}
3553
args:
3654
creates: "{{ artefact_dir }}{{ artefact_name }}"
3755

38-
- name: Obtain the current tag (or branch if untagged) of this repository.
39-
shell: |
40-
TAG=$(git name-rev --tags --name-only HEAD | cut -f1 -d^)
41-
if [ "$(echo $TAG | tr -d [:space:])" == "undefined" ]; then
42-
git describe --all | grep -o [^/]*$
43-
else
44-
echo $TAG
45-
fi
46-
args:
47-
chdir: "{{ container_dir }}"
48-
executable: /bin/bash
49-
register: current_branch
56+
# Storing container with tag=branch.
57+
58+
- name: Define the name used for the output Docker image using the branch.
59+
set_fact:
60+
output_image_name_branch: virtualmicromagnetics/{{ container_name }}:{{ branch.stdout }}
5061

51-
- name: Define the name used for the output Docker image
62+
- name: Create a Docker image from our provisioned container.
63+
command: docker commit {{ container_name }} {{ output_image_name_branch }}
64+
65+
- name: Push the Docker image with tag equal to branch.
66+
command: docker push {{ output_image_name_branch }}
67+
when: container_push
68+
69+
# Storing container with tag=tag.
70+
71+
- name: Define the name used for the output Docker image using the tag.
5272
set_fact:
53-
output_image_name: virtualmicromagnetics/{{ container_name }}:{{ current_branch.stdout }}
73+
output_image_name_tag: virtualmicromagnetics/{{ container_name }}:{{ tag.stdout }}
74+
when: tag.stdout != "undefined"
5475

5576
- name: Create a Docker image from our provisioned container.
56-
command: docker commit {{ container_name }} {{ output_image_name }}
77+
command: docker commit {{ container_name }} {{ output_image_name_tag }}
78+
when: tag.stdout != "undefined"
79+
80+
- name: Push the Docker image with tag equal to tag.
81+
command: docker push {{ output_image_name_tag }}
82+
when: (container_push == "true") and (tag.stdout != "undefined")
5783

58-
- name: Push the Docker image.
59-
command: docker push {{ output_image_name }}
84+
# Remove the evidence.
6085

6186
- name: Destroy the container.
6287
command: vagrant destroy --force

jobs/hook_vm.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,13 @@
6969
when: (not vagrantfile.stat.exists) and (not box_status.stat.exists or (box_status.stat.isreg and clobber_output))
7070

7171
- name: Extract the virtual machine disk (VMDK) file from the box.
72-
command: tar -xvf {{ output_box }} -C {{ artefact_dir }} ./box-disk1.vmdk
72+
command: tar -xzvf {{ output_box }} -C {{ artefact_dir }} ./box-disk1.vmdk
7373
chdir={{ artefact_dir }}
7474
creates={{ artefact_dir }}/box-disk1.vmdk
7575
when: not zip_status.stat.exists or (zip_status.stat.isreg and clobber_output)
76+
register: result
77+
until: result.rc == 0
78+
retries: 3
7679

7780
- name: Convert the virtual machine disk (VMDK) to a virtual hard disk (VHD).
7881
command: VBoxManage clonehd --format VHD box-disk1.vmdk {{ output_name }}.vhd

jobs/provision_virtualmicromagnetics_fidimag.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
- { role: rst_to_html, SOURCE_PATH: "/vagrant/extra_resources/welcome/welcome_{{ name }}.rst" }
1414
- fidimag
1515
- fidimag_examples
16-
- xserver
17-
- add_super_user
1816
- { role: xserver, when: type == "vm" }
1917
- { role: add_super_user, when: type == "vm" }
2018
- { role: copy_skeleton, TYPE: type }

roles/create_container/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
executable: /bin/bash
8484

8585
- name: Start the container. Vagrant may attempt to install VirtualBox Guest Additions here.
86-
shell: vagrant up --no-provision > {{ container_name }}.log
86+
shell: vagrant up --no-provision --provider docker > {{ container_name }}.log
8787
chdir={{ container_dir }}
8888

8989
- name: Provision the container. A log exists in machines/.

roles/fidimag/tasks/make_fidimag.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
# SUNDIALS.
55

66
# Install local dependencies.
7-
- name: Install FFTW and SUNDIALS from the Fidimag installation script.
8-
command: bash ubuntu_install_script.sh
7+
- name: Install FFTW and SUNDIALS from Fidimag installation scripts.
8+
command: bash {{ item }}
99
args:
1010
chdir: "{{ FIDIMAG_INSTALL_PATH }}/bin"
11+
with_items:
12+
- install-fftw.sh
13+
- install-sundials-2.5.sh
1114
sudo: yes
1215

1316
# Build Fidimag. Makefile module?

0 commit comments

Comments
 (0)