So you want to bring some applications to the gridcloud eh ... ?
This is a training and demonstration repo for writing -deploy jobs for our build and deploy system at http://ci.sagrid.ac.za
In general we want to make access to the SAGrid build system as open as possible, but manage the rights of anyone who wants to contribute. Since we want to automate as much as possible the delivery of new applications in this distributed environment, we need to have a stepping-stone project which can be personally managed by new users. This is the purpose of this repo.
This repository is to demonstrate, with high verbosity, how we expect new applications to be built, tested and deployed. This repository is thus an expression of good practice. As it is tested - like all other -deploy
repos - with every commit, it is also an expression of the functional state of this good practice.
Every jenkins job is connected to specific repo. Let's say you have a new application which you want to port - myapp
. In order to get started, we expect you to
- become a member of this organisation on github.
- fork this repo to your own github account (@user/myapp-deploy) and add the relevant files (see below)
- for your own repo to this organisation with your app name (@SouthAfricaDigitalScience/myapp-deploy). This will allow us to collaboratively provide suggestions to your new project. Do not edit this repo directly.
- We will create the job on jenkins and add the repo to it's configuraiton. When changes are pushed to any of the collaborators, the project will be built and tests run.
- Try to use the definitive source for the application.
- Separate build tests and functional tests
- Try to implement as many functional tests as possible - you are building for more than one OS.
- Check your dependencies and use the modules which the build system provides for you - do not unnecessarily build dependencies, rather request that the existing dependencies are built according to your satisfaction.
Each deploy job should have at least two executable scripts :
build.sh
check-build.sh
These define basically two test phases, the build and functional test phases respectively.
The build phase should do the following things
- Set up the build environment variables
- Check out the source code
- Configure the build
- Compile the source into an executable form.
- Create a modulefile which loads the dependencies and sets the environment variables needed to execute the application.
The build phase should pass iff the expected libraries and executable files are present. It is your responsibility to define where these files are, on a case-by-case basis.
Here you are expected to prove that the application actually executes a test payload. You should write a script called check-buld.sh
which does the following things:
- Load the modulefile created by
build.sh
- Execute the application with a predefined input or configuration - it is your responsibility to provide this.
- Check the validity of the output of the applicaiton - this may vary vastly between applications, but is likely to be something on
stdout
or the presence and content of a particular file.
If you want to discuss this, or the whole system itself - either ask questions or make proposals for improvement, etc - please start a topic at the discussion forum.
If you have a legitimate error, or need support, please open an issue
Foundation Release 1 was published on 7th December 2015. This provided the basic platform with many tweaks still necessary.