Git Product home page Git Product logo

ocurrent.org's Introduction

OCurrent.org

OCurrent.org is the town hall for all OCurrent related stuffs.

⚠️ This is currently on heavy development and as a result not stable at all!

Pipeline

The OCurrent.org website is able to rebuild itself if the documentation change in the various repositories it tracks. This is achieved by running an ocurrent pipeline:

pipeline

Development

Dependencies

To be able to develop with OCurrent, you need to have the following tools installed on your system:

  • opam (>= 2.0)
  • hugo (>= 0.100)

To install hugo, you can follow these instructions on the gohugo.io website.

Run a development server

To run a development server, you can run this command and go to localhost:1313 to see the result:

hugo server -v

To build the page as a static website, you can execute this command the website will be built into ./public:

hugo --minify -d "./public"

Deployement - Pipeline

Step 1

To run the pipeline, you need to create a GitHub App with the following permissions:

Content: Read-Only
Meta-data: Read-Only

and subscribe to the event Push. You also have to add a pointer to the /webhooks/github entry point. This repository will be the base of the website that is going to be built. In the Wehooks section, insert the following parameters:

  • Payload URL: url-of-your-pipeline-entry-point/webhooks/github
  • Secret: choose a random character string for it

You need to generate a private key for the client and store it somewhere. Finally, the application needs to be installed in the repository where the configuration (tracker.yml) is stored.

Step 2

You need to have an ssh key on the server where the pipeline is deployed. Otherwise, you can create one by followning this tutorial. Then you should go to the repository where your code will be pushed and add a deploy key (an ssh key only related to this repository). To do so, go to https://github.com/USER/REPO/settings/keys.

Now, we are ready to run our pipeline.

Step 3

Clone this repository, and install opam dependencies (we assume that you have hugo and, opam):

git clone https://github.com/ocurrent/ocurrent.org.git
opam switch create . --deps-only
eval $(opam env)

Ensure you have your secret in a file (secret-file) and your key (key.pem) too and run:

dune exec -- bin/main.exe --github-account-allowlist="<USER>" \
                          --github-app-id="<ID>" \
                          --github-private-key-file="key.pem" \
                          --github-webhook-secret-file="secret-file" \
                          --branch="master" \
                          -v

And, tada, the pipeline is now live ✌️

Deployement - Config format

As mentionned above, you need to have a file named tracker.yml in the repository you add to the command line so it is able to konw what to do with it. Here is an example of such a file:

output:
  owner: "ocurrent"
  name: "ocurrent.github.io"
  branch: "main"
repos:  
  - owner: "ocurrent"
    name: "ocurrent"
    files:
      - title: "Index"
        summary: "Main file for the repo"
        src: "doc/index.md"
        dst: "content/docs/ocurrent/ocurrent.md"
        authors:
          - "John Doe"
      - title: "Disk cache"
        summary: "About the disk cache"
        src: "doc/disk_cache.md"
        dst: "content/docs/ocurrent/doc.md"
        authors:
          - "Jane Smith"
          - "Robert Hammer"
  - owner: "ocurrent"
    name: "ocaml-ci"
    files:
      - title: "Local_dev"
        summary: "Local dev"
        src: "doc/dev.md"
        dst: "content/docs/ocurrent/local.md"
        authors:
          - "Mary Bonnie"
indexes:
  - title: "OCurrent Index"
    description: "List of ocurrent documentation"
    dst: "content/docs/ocurrent/"

It's splitted in three sections: output, repos and, indexes. output is the description of the repository where you are going to commit in. The branch on which it will be pushed should already exist. repos is a reference to the repositories you are tracking and the files you want to track into it. indexes is the _index.md creator for hugo so we can split collections with hugo.

Output

output:
  owner: "USER"
  name: "REPO"
  branch: "BRANCH"

Files

repos:
  - owner: "USER"
    name: "REPO"
    files:
      - title: "Title displayed on the website"
        summary: "The brief explanation about what it is"
        src: "relative/path/to/the/file/from/user/repo/root"
        dst: "relative/path/to/the/file/from/output/repo/root"
        authors:
          - "Who writes this?"

Indexes

indexes:
  - title: "Title displayed as a section on the website"
    description: "Brief documentation about it"
    dst: "relative/path/to/the/dir/from/output/repo/root"

ocurrent.org's People

Contributors

craigfe avatar maiste avatar mtelvers avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocurrent.org's Issues

Support mermaid.js build

Background

Some of our documentation use mermaid.js to create diagrams about various mechanisms. Being able to display them can be a really nice feature.

Outcome

We should parse the page's code and transform the mermaid code into something readable by Hugo.

Support images copy

Background

The current system only supports copying files. This feature would require tweaking the system and the configuration to be able to move images between the various elements.

Outcome

The YAML file will support image copy by adding a data field:

files:
  - [...]
data:
  -  src: "doc/dev.md"
     dst: "content/docs/ocurrent/local.md"

Add Prometheus endpoint

Background

The watcher pipeline is in charge of building the pages for the ocurrent.org website. It runs once a week and ensures the documentation is up to date. Currently, we don't have any metrics about what the system does.

Summary

The goal is to gather and expose data through Prometheus. The metrics would be:

  • Number of builds/pages done this week
  • Size of the website
  • Number of times we hit the cache (ensure we are caching the information well)

Outcome

It will be possible to fetch this data thanks to a Prometheus endpoint.

Import documentation from the outside world

Background

The watcher pipeline is in charge of building the pages for the ocurrent.org website. It runs once a week and ensures the documentation is up to date. As it picks the data from various ocurrent repositories, we need to specify what it should import.

Outcome

The ocurrent.org website will import pages from other repositories; see the following list:

  • Multicore-ci: readme
  • OCaml-ci: dev & readme
  • Opam-repo-ci: readme
  • Opam-health-check: readme
  • ocaml-docs-ci: readme and doc (might need to import mermaid.js)
  • docker-base-images: readme
  • ocurrent-deployer: readme

Support mermaid.js build

Background

Some of our documentation use mermaid.js to create diagrams about various mechanisms. Being able to display them can be a really nice feature.

Outcome

We should parse the page's code and transform the mermaid code into something readable by Hugo.

Document the pipeline

What to document

Taking inspiration from the tarides.com blog post about ocurrent.org, there should be a document about the pipeline, like for ocaml-docs-ci, to explain how it is built and run under the hood. The README needs to be entirely rewritten to be more technical and specific.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.