Commit 3dca0e01 authored by Jean-Francois Rey's avatar Jean-Francois Rey
Browse files

update readme

parent 8de58c79
# Windows 10 Virtual Machine, R environment, as GitLab Runner
If you want to develop and test your R packages, build R packages binaries under/for windows automatically, this is the right place.
If you want to develop, tests and check your R packages, build R packages binaries under/for Windows automatically, this is the right place.
> Create a VirtualBox under windows 10 with R (Version >= 4.0.0) and Rtools + some dependencies. And register it as a GitLab Runner.
[[_TOC_]]
## The Idea
![Project pipeline windows R](images/GitLab_Runner_pipeline_R.png)
__The main purpose of this project is to automate the creation of a R environment under Windows to use it as a GitLab Runner in CI/CD pipelines.__
Here the steps :
1. Get a VirtualBox Machine from [VagrantCloud](https://app.vagrantup.com/) (a box) under windows 10, generated by [Packer](https://www.packer.io/). More information [here](https://forgemia.inra.fr/gaev/packer/windows10).
2. Initialysing and configuring the VM using [Vagrant](https://www.vagrantup.com/). See [VagrantFile](VagrantFile) template.
3. Provisioning and configuring the VM using [Ansible](https://ww.ansible.com). See [ansible\_provisioning/playbook.yml](ansible\_provisioning/playbook.yml) and scripts in [ansible\_provisioning/files/](ansible\_provisioning/files/) :
- Update Windows
- Install R (>= 4.0.0)
- Install Rtools (>= Rtools40)
- Configure msys2 environment (Rtools dependencies)
- Install sshd (under msys2)
- Install some R packages and system dependencies
- Install GitLab-Runner for artifacts (lastest version)
- Install MiKTex (lastest version)
- Install Pandoc (2.10.1)
4. Generating a new Vagrant box
5. Registering this new VM as a GitLab Runner (snapshot version)
## Dependencies
A bare metal or a Virtual Machine with nested Virtualization on the hypervisor activated as a server with dependencies installed.
A bare metal or a Virtual Machine with nested Virtualization on the hypervisor activated as a server with dependencies installed. (Tested under Linux OS)
### Systems
### System
* VirtualBox (>=6.1.14) and extension Pack
* Vagrant (>=2.2.10)
* Ansible (>=2.2.1.0)
* pywinrm (>=0.3.0) compatible with Ansible Python version (defualt is 2)
* GitLab-Runner (>= 10.0.0)
* [VirtualBox](https://www.virtualbox.org/) (>=6.1.14) and extension Pack
* [Vagrant](https://www.vagrantup.com/) (>=2.2.10)
* [Ansible](https://www.ansible.com/) (>=2.2.1.0)
* [pywinrm](https://github.com/diyan/pywinrm) (>=0.3.0) compatible with Ansible Python version
* [GitLab-Runner](https://docs.gitlab.com/runner/install/) (>= 10.0.0)
### GitLab Runner
Use GitLab-Runner to register a _shell_ runner. _gitlab-runner_ user have to get access to _vboxmanage_, _vagrant_ and _ansible_.
To register the virtualbox runner create here, called _WIN10R4_.
To register the VirtualBox Runner created here, called _WIN10R4_.
```bash
gitlab-runner register \
--non-interactive \
......@@ -38,7 +60,7 @@ gitlab-runner register \
--virtualbox-base-snapshot = "bootR4"
```
To use this runner, add in your .gitlab-ci.yml jobs:
To use this Runner, add in your .gitlab-ci.yml jobs:
```
tags:
- windows
......@@ -50,8 +72,9 @@ tags:
Every things happen in the [.gitlab-ci.xml](.gitlab-ci.xml) file.
Mainly the [VagrantFile](VagrantFile) set up a virtual machine from Vagrant Cloud [GAEV/win10](https://app.vagrantup.com/GAEV/boxes/win10) box (a windows10 professional evaluation version with vbBoxGuestAditions).
Files in [provisioning/](provisioning/) are playbooks for Ansible that will install/configure R, Rtools, packages, MiKTeX, Pandoc and GitLab-Runner.
After the virtual machine creation and configuration, it registered as a new gitlab-runner (by replacing the existing virtualbox machine "WIN10R4").
Files in [ansible_provisioning/](ansible_provisioning/) are playbooks for Ansible that will install/configure R, Rtools, packages, MiKTeX, Pandoc and GitLab-Runner.
After the Virtual Machine creation and configuration, it registered as a new gitlab-runner (by replacing the existing virtualbox machine "WIN10R4").
Bonus : The VM (box) is save/backup in a OpenStack Object Store [Swift](https://wiki.openstack.org/wiki/Swift).
## Locally
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment