diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 44ec701ce8211adc270e8c0762a0702e5bebb362..32b6c1eb0623049ce0e2e9bfc8859483b4f25127 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,20 @@ +# The stages where jobs run. Each stage contains one or more jobs that run independently from one another +# Use stages to define dependencies and artifacts from previous stages. stages: - compile - submit +# Job name compile-mandelbrot: + # Stage name stage: compile + # Script in shell - can use other executors: docker-ssh+machine, docker-ssh, virtualbox etc. script: - gcc mandelbrot.c artifacts: paths: - a.out + # Tag - an identifier to match a job with a specified machine. Useful for different provisions required by a machine. tags: - steve-jobs diff --git a/README.md b/README.md index 7cc4242ced73a178f7f3c154ea12583587033284..5ddb5b2e182ecd1237a6d70ffb699dc549fd4dce 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,33 @@ -# Gitlab-CI/Condor: Mandelbrot +# Gitlab-CI & Condor: Mandelbrot Tutorial -Black and white Mandelbrot in C. +A Mandelbrot program generator using C. ## Running locally -In a local shell, run: +After you have navigated to your directory in a local shell, you should begin by compiling and running the mandelbrot first. Considering we are using a gcc compiler in C, things should work without any problems here. Run: ``` gcc mandelbrot.c ``` ``` ./a.out ``` -Now open the generated .ppm file! +Now open the newly generated/regenerated mandelbrot.ppm file using -## Running with Gitlab-CI on a Local Gitlab Runner +``` +open mandelbrot.ppm +``` + +## Gitlab-CI on a Local Machine + +It is a good idea to learn the basics of Gitlab CI by installing a runner on a local machine first. In this way, you will have more control over your runner abilities thru the Gitlab API, and more notably any permissions issues your runner can sometimes run often into. + +Cool. So now go and install a [binary runner on your machine.](https://docs.gitlab.com/runner/install/#binaries) + +We will try to cover the basic syntax for extending and running a job with gitlab-ci, but after downloading this repo, you can jump into the YAML syntax for [configuring your jobs](https://docs.gitlab.com/ee/ci/yaml/) + +I will also cover the basics on pipelines, but you can start reading more [in-depth stuff on this here](https://docs.gitlab.com/ee/ci/pipelines.html) + +You can see some other [example projects](https://docs.gitlab.com/ee/ci/examples/README.html) that utilise gitlab-ci in various languages example projects. + +## Gitlab-CI in the Condor Pool -## Running with Gitlab-CI on a Condor Runner +In part II of this series in January, we will attempt to use a Gitlab-CI as a means to submitting jobs with HTCondor through ```condor_submit``` diff --git a/mandelbrot.c b/mandelbrot.c index cdcc525e76249ada1b3e9dd49832606e249d1102..e473255bd33c2cdf63173d0ec84b7d2a691bfb59 100644 --- a/mandelbrot.c +++ b/mandelbrot.c @@ -16,8 +16,8 @@ int main() { /* screen ( integer) coordinate */ int iX,iY; - const int iXmax = 8000; - const int iYmax = 8000; + const int iXmax = 2000; + const int iYmax = 2000; /* world ( double) coordinate = parameter plane*/ double Cx,Cy; const double CxMin=-2.5; @@ -31,7 +31,7 @@ int main() /* it is 24 bit color RGB file */ const int MaxColorComponentValue=255; FILE * fp; - char *filename="new1.ppm"; + char *filename="mandelbrot.ppm"; char *comment="# ";/* comment should start with # */ static unsigned char color[3]; /* Z=Zx+Zy*i ; Z0 = 0 */ @@ -83,6 +83,7 @@ int main() }; /*write color to the file*/ fwrite(color,1,3,fp); + // printf("CXMin-value = %f, Cx = %f\n CYMin-Value= %f, CYValue= %f\n", CxMin , Cx, CyMin, Cy); } } fclose(fp);