Skip to content

Commit

Permalink
Deploy ec1cde1e289c14bd4e276cb85e9a2814367a1e41
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarides Pipeline committed May 8, 2024
1 parent 552bc2e commit 61ba733
Show file tree
Hide file tree
Showing 26 changed files with 205 additions and 175 deletions.
4 changes: 2 additions & 2 deletions docs/docker-base-images/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<description>Recent content in Docker Base Images on OCurrent</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Thu, 20 Jul 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ocurrent.org/docs/docker-base-images/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Wed, 08 May 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ocurrent.org/docs/docker-base-images/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Readme</title>
<link>https://www.ocurrent.org/docs/docker-base-images/readme/</link>
<pubDate>Thu, 20 Jul 2023 00:00:00 +0000</pubDate>
<pubDate>Wed, 08 May 2024 00:00:00 +0000</pubDate>

<guid>https://www.ocurrent.org/docs/docker-base-images/readme/</guid>
<description>Readme</description>
Expand Down
6 changes: 3 additions & 3 deletions docs/docker-base-images/readme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<meta property="og:description" content="Readme" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://www.ocurrent.org/docs/docker-base-images/readme/" /><meta property="article:section" content="docs" />
<meta property="article:published_time" content="2023-07-20T00:00:00+00:00" />
<meta property="article:modified_time" content="2023-07-20T00:00:00+00:00" />
<meta property="article:published_time" content="2024-05-08T00:00:00+00:00" />
<meta property="article:modified_time" content="2024-05-08T00:00:00+00:00" />

<link
rel="stylesheet"
Expand Down Expand Up @@ -84,7 +84,7 @@ <h1>
<h1>Readme</h1>


<p><a href="https://ci.ocamllabs.io/github/ocurrent/docker-base-images"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fci.ocamllabs.io%2Fbadge%2Focurrent%2Fdocker-base-images%2Fmaster&amp;logo=ocaml" alt="OCaml-CI Build Status"></a></p>
<p><a href="https://ocaml.ci.dev/github/ocurrent/docker-base-images"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Focaml.ci.dev%2Fbadge%2Focurrent%2Fdocker-base-images%2Fmaster&amp;logo=ocaml" alt="OCaml-CI Build Status"></a></p>
<p>This is an <a href="https://github.com/ocurrent/ocurrent">OCurrent</a> pipeline that builds Docker images for OCaml, for
various combinations of Linux distribution, Windows version, OCaml version
and architecture.</p>
Expand Down
28 changes: 14 additions & 14 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ <h2>Opam Repo CI</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Readme</div>
</div>
Expand All @@ -177,7 +177,7 @@ <h2>Opam Health Check</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Readme</div>
</div>
Expand All @@ -196,7 +196,7 @@ <h2>OCurrent Deployer</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">VM Host Machine</div>
</div>
Expand All @@ -208,7 +208,7 @@ <h2>OCurrent Deployer</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Readme</div>
</div>
Expand All @@ -227,7 +227,7 @@ <h2>OCurrent</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Write your own plugin</div>
</div>
Expand All @@ -239,7 +239,7 @@ <h2>OCurrent</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">The build cache</div>
</div>
Expand All @@ -251,7 +251,7 @@ <h2>OCurrent</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Internal overview</div>
</div>
Expand All @@ -263,7 +263,7 @@ <h2>OCurrent</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Example pipelines</div>
</div>
Expand All @@ -282,7 +282,7 @@ <h2>OCaml Multicore CI</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Readme</div>
</div>
Expand All @@ -301,7 +301,7 @@ <h2>OCaml Docs CI</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Readme</div>
</div>
Expand All @@ -320,7 +320,7 @@ <h2>OCaml CI</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Readme</div>
</div>
Expand All @@ -332,7 +332,7 @@ <h2>OCaml CI</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Development notes</div>
</div>
Expand All @@ -344,7 +344,7 @@ <h2>OCaml CI</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Deploy on Docker</div>
</div>
Expand All @@ -363,7 +363,7 @@ <h2>Docker Base Images</h2>

</div>
<div class="metadata">
by The OCurrent Team on July 20, 2023
by The OCurrent Team on May 8, 2024
</div>
<div class="summary">Readme</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<description>Recent content in OCurrent Docs on OCurrent</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Thu, 20 Jul 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ocurrent.org/docs/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Wed, 08 May 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ocurrent.org/docs/index.xml" rel="self" type="application/rss+xml" />
</channel>
</rss>
81 changes: 37 additions & 44 deletions docs/ocaml-ci/dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<meta property="og:description" content="Development notes" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://www.ocurrent.org/docs/ocaml-ci/dev/" /><meta property="article:section" content="docs" />
<meta property="article:published_time" content="2023-07-20T00:00:00+00:00" />
<meta property="article:modified_time" content="2023-07-20T00:00:00+00:00" />
<meta property="article:published_time" content="2024-05-08T00:00:00+00:00" />
<meta property="article:modified_time" content="2024-05-08T00:00:00+00:00" />

<link
rel="stylesheet"
Expand Down Expand Up @@ -85,9 +85,9 @@ <h1>Development notes</h1>


<h1 id="local-development">Local development</h1>
<p>This document sets you up to use locally running instances of <code>ocaml-ci-service</code> and <code>ocaml-ci-web</code> to build an OCaml project that is in a repository owned by your GitHub user.</p>
<h3 id="setting-up-a-github-app">Setting up a GitHub App</h3>
<p>Since <code>ocaml-ci</code> is a GitHub App, create a GitHub App (<a href="https://github.com/settings/apps">settings/apps</a>) under your own user and point it to localhost via a webhook payload delivery service like <a href="https://smee.io">smee.io</a>.</p>
<p>This document sets you up to use local instances of <code>ocaml-ci-service</code> and <code>ocaml-ci-web</code> running in Docker containers to build an OCaml project that is in a repository owned by your GitHub user.</p>
<h2 id="setting-up-a-github-app">Setting up a GitHub App</h2>
<p><code>ocaml-ci</code> uses the functionality of a GitHub App to interact with GitHub. To use <code>ocaml-ci</code> yourself you must create your own. You can create a GitHub App (<a href="https://github.com/settings/apps">settings/apps</a>) under your own user and point it to localhost via a webhook payload delivery service like <a href="https://smee.io">smee.io</a>.</p>
<p>To do this, follow the instructions in <a href="https://docs.github.com/en/developers/apps/getting-started-with-apps/setting-up-your-development-environment-to-create-a-github-app">Setting up your development environment to create a GitHub App</a> but when it comes to setting permissions for your app, set the following as the &ldquo;Repository permissions&rdquo;:</p>
<pre tabindex="0"><code>Checks: Read and write
Commit statuses: Read and write
Expand All @@ -98,49 +98,42 @@ <h3 id="setting-up-a-github-app">Setting up a GitHub App</h3>
<pre tabindex="0"><code>Create
Pull request
Push
</code></pre><h3 id="running-the-github-pipeline-locally">Running the GitHub pipeline locally</h3>
</code></pre><h2 id="running-the-github-pipeline-locally">Running the GitHub pipeline locally</h2>
<p>You will need the following:</p>
<ol>
<li>The GitHub App ID of the app you created</li>
<li>The <code>pem</code> file containing the private key associated to the app</li>
<li>A comma separated list of GitHub accounts to allow - this could start out as just your GitHub account</li>
<li>A capability file for submitting jobs to a cluster, in this case the main ocaml-ci cluster as documented in <a href="https://github.com/ocurrent/ocluster#admin">https://github.com/ocurrent/ocluster#admin</a></li>
<li>The app webhook secret that is used to authenticate to the app</li>
<li>A comma-separated list of GitHub accounts to allow—this could start out as just your GitHub account</li>
<li>A file <code>private-key.pem</code> containing the private key associated with the app</li>
<li>A file <code>webhook-secret</code> containing the webhook secret that is used to authenticate with the app</li>
</ol>
<pre tabindex="0"><code>dune exec -- ocaml-ci-service \
--github-app-id &lt;your-github-app-id&gt; \
--github-private-key-file &lt;path-to/private-key.pem&gt; \
--github-account-allowlist &lt;your-github-username&gt; \
--submission-service &lt;path-to-the-submission-capability-file&gt; \
--github-webhook-secret-file &lt;path-to-the-app-secret&gt; \
--capnp-listen-address tcp:127.0.0.1:9001
--migration-path &#34;$PWD/migrations&#34;
</code></pre><p>This will generate a capability file. See the logs for <code>Wrote capability reference to &quot;./capnp-secrets/ocaml-ci-admin.cap&quot;</code></p>
<p>You should see the admin site on <code>localhost:8080</code></p>
<h3 id="running-the-gitlab-pipeline-locally">Running the GitLab pipeline locally</h3>
<p>You will need the following:</p>
<ol>
<li>The GitLab API token with permissions to the repositories to build</li>
<li>GitLab secret associated with webhooks</li>
<li>A capability file for submitting jobs to a cluster, in this case the main ocaml-ci cluster as documented in <a href="https://github.com/ocurrent/ocluster#admin">https://github.com/ocurrent/ocluster#admin</a></li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">dune <span class="nb">exec</span> -- ocaml-ci-gitlab <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --gitlab-token-file &lt;your-gitlab-token&gt; <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --gitlab-webhook-secret-file &lt;your-gitlab-secret&gt; <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --submission-service &lt;path-to-the-submission-capability-file&gt; <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --capnp-listen-address tcp:127.0.0.1:9800
</span></span><span class="line"><span class="cl"> --migration-path <span class="s2">&#34;</span><span class="nv">$PWD</span><span class="s2">/migrations&#34;</span>
</span></span></code></pre></div><p>This will generate a capability file. See the logs for <code>Wrote capability reference to &quot;./capnp-secrets/ocaml-ci-gitlab-admin.cap&quot;</code></p>
<h3 id="running-the-web-client-locally">Running the web client locally</h3>
<p>Using the capability file written out by the service, run the web client as follows:</p>
<pre tabindex="0"><code>dune exec -- ocaml-ci-web \
--backend ./capnp-secrets/ocaml-ci-admin.cap \
--gitlab-backend ./capnp-secrets/ocaml-ci-gitlab-admin.cap
</code></pre><p>You should see the client site on <code>localhost:8090</code> note that both backends are optional so you can run just the github or gitlab pipelines.</p>
<h3 id="running-a-scheduler-and-a-worker-optional">Running a scheduler and a worker (OPTIONAL)</h3>
<p>You can run a scheduler and a worker to connect it to the CI.
Follow the instruction from <a href="https://github.com/ocurrent/ocluster#the-scheduler-service">ocurrent/ocluster</a>.</p>
<h3 id="migrations">Migrations</h3>
<p><code>private-key.pem</code> and <code>webhook-secret</code> must be stored in the same directory on the host. The directory path will be needed.</p>
<p>Create a file <code>/etc/caddy/Caddyfile</code> containing:</p>
<pre tabindex="0"><code>{
log default {
level WARN
}
}

http://localhost:8100 {
reverse_proxy service:8080
}

http://localhost {
reverse_proxy web:8090
}
</code></pre><p>You can then start the services with:</p>
<pre tabindex="0"><code>APP_ID=... ALLOW_LIST=... SECRETS_DIR=... docker compose up
</code></pre><p>You should see the admin site on <a href="http://localhost:8100"><code>http://localhost:8100</code></a> and the user site on <a href="http://localhost"><code>http://localhost</code></a>.</p>
<p>Alternatively, you can store the environment variables in a <code>.env</code> file at the root of the project. For example:</p>
<pre tabindex="0"><code>APP_ID=359343
ALLOW_LIST=&#34;myusername,ocurrent&#34;
SECRETS_DIR=$HOME/ci_secrets/
</code></pre><p>You can then run the compose as simply:</p>
<pre tabindex="0"><code>docker compose up
</code></pre><p>If you want webhooks to be directed to your application, start <code>smee</code> in another terminal, replacing the argument to <code>--url</code> with the URL you generated before on <a href="https://smee.io">smee.io</a>:</p>
<pre tabindex="0"><code>smee --url https://smee.io/xxxxxxxxxxxxxxxx --path /webhooks/github --port 8100
</code></pre><p>Make sure that the GitHub App is sending webhooks to the URL, specified in its settings.</p>
<h2 id="migrations">Migrations</h2>
<p>Migrations are managed using <code>omigrate.</code> If you are using an opam switch for ocaml-ci then <code>omigrate</code> should be installed and you can create a new migration by doing this from the project root:</p>
<pre tabindex="0"><code>omigrate create --dir migrations &lt;migration-name&gt;
</code></pre><p>This will create timestamped files in the <code>migrations</code> directory that you can then populate with the sql necessary to introduce and remove the migration (in the <code>up</code> and <code>down</code> files respectively).</p>
Expand Down
4 changes: 2 additions & 2 deletions docs/ocaml-ci/docker-deployment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<meta property="og:description" content="Deploy on Docker" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://www.ocurrent.org/docs/ocaml-ci/docker-deployment/" /><meta property="article:section" content="docs" />
<meta property="article:published_time" content="2023-07-20T00:00:00+00:00" />
<meta property="article:modified_time" content="2023-07-20T00:00:00+00:00" />
<meta property="article:published_time" content="2024-05-08T00:00:00+00:00" />
<meta property="article:modified_time" content="2024-05-08T00:00:00+00:00" />

<link
rel="stylesheet"
Expand Down
8 changes: 4 additions & 4 deletions docs/ocaml-ci/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<description>Recent content in OCaml CI on OCurrent</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Thu, 20 Jul 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ocurrent.org/docs/ocaml-ci/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Wed, 08 May 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://www.ocurrent.org/docs/ocaml-ci/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Deploy on Docker</title>
<link>https://www.ocurrent.org/docs/ocaml-ci/docker-deployment/</link>
<pubDate>Thu, 20 Jul 2023 00:00:00 +0000</pubDate>
<pubDate>Wed, 08 May 2024 00:00:00 +0000</pubDate>

<guid>https://www.ocurrent.org/docs/ocaml-ci/docker-deployment/</guid>
<description>Deploy on Docker</description>
Expand All @@ -19,7 +19,7 @@
<item>
<title>Development notes</title>
<link>https://www.ocurrent.org/docs/ocaml-ci/dev/</link>
<pubDate>Thu, 20 Jul 2023 00:00:00 +0000</pubDate>
<pubDate>Wed, 08 May 2024 00:00:00 +0000</pubDate>

<guid>https://www.ocurrent.org/docs/ocaml-ci/dev/</guid>
<description>Development notes</description>
Expand All @@ -28,7 +28,7 @@
<item>
<title>Readme</title>
<link>https://www.ocurrent.org/docs/ocaml-ci/readme/</link>
<pubDate>Thu, 20 Jul 2023 00:00:00 +0000</pubDate>
<pubDate>Wed, 08 May 2024 00:00:00 +0000</pubDate>

<guid>https://www.ocurrent.org/docs/ocaml-ci/readme/</guid>
<description>Readme</description>
Expand Down
Loading

0 comments on commit 61ba733

Please sign in to comment.