## Description While trying to work on https://github.com/alcionai/corso/issues/1166, I ended up reworking parts of the build script ~, but I'm running into some issues with building it on CI. Pushing it here just for reference.~ The new one combines both `build.sh` and `build-container.sh` into a single script where you can specify what to build. Also, inorder setup a proper multi arch, build system locally, we will have to properly setup buildx which is explained in https://docs.docker.com/build/building/multi-platform/ or https://stackoverflow.com/a/70837025/2724649 . I'll add this instructions to docs. The new build script looks something like this: ``` Usage: build.sh <binary|image> [--platforms ...] [--tag ...] OPTIONS -p|--platforms Platforms to build for (default: linux/amd64) Specify multiple platforms using ',' (eg: linux/amd64,darwin/arm) -t|--tag Tag for container image (default: alcionai/corso) ``` --- I've made sure the image and binary has the proper architecure and that the amd64 one runs properly in my system. It would be helpful if someone who has access to arm system can validate the arm image. You can use https://github.com/alcionai/corso/pkgs/container/corso/45878348?tag=84fc9d4 image to verify. ``` $ cat check-image.sh imgid="$(docker create "$1")" docker cp "$imgid:corso" /tmp/corso echo Image: "$(docker inspect "$1" | jq '.[0].Architecture')" echo Binary: "$(file /tmp/corso)" $ ./check-image.sh ghcr.io/alcionai/corso:84fc9d4@sha256:2278a2b4f108e5dd2ae545f53da1d151b77171f969ffd9718e4bb9886e332ee2 WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64) and no specific platform was requested Image: "arm64" Binary: /tmp/corso: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, Go BuildID=7iTBXW0reyfIOS-b-ciS/a5K0Q1IjuA0m9DJxmuNk/Ju1lI6bUZeKn6M_xqon6/KNXwYSnL7e5RVtjAKW9A, not stripped $ ./check-image.sh ghcr.io/alcionai/corso:84fc9d4@sha256:6320b95470014ca07b9cf1db98b73f5672870c2c53c22c3d13223d88fa621ee0 Image: "amd64" Binary: /tmp/corso: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, Go BuildID=sBziMHPFI9K-G0et0WjJ/Pe9A2Vy8_xpV3FEDJUMo/p4UeMEzgheASvylZ1N3j/fnwmDeVif4rhneou-S6O, not stripped $ docker run -it --rm ghcr.io/alcionai/corso:84fc9d4@sha256:6320b95470014ca07b9cf1db98b73f5672870c2c53c22c3d13223d88fa621ee0 [...help message...] ``` ## Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [x] 💻 CI/Deployment - [ ] 🐹 Trivial/Minor ## Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * https://github.com/alcionai/corso/issues/1166 ## Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
Corso documentation
Corso documentation uses Docusaurus 2, a modern static website generator. Mermaid provides support for native diagrams in Markdown.
Requirements
Developing documentation for Corso requires the following tools on your machine:
make- Docker
Installation
make buildimage
Live documentation development
make dev
This command starts a local development server within the Docker container and will expose docs at http://localhost:3000.
Generating Corso CLI docs
make genclidocs
Corso's CLI documents are auto generated. This command explicitly triggers generating these docs. This step will happen automatically for the other commands where this is relevant.
Building static documentation
make build
This command generates static content into the build directory for integration with any static contents hosting service.
Style and linting
# Lint all docs
make dockercheck
# Lint specific files and/or folders
make dockercheck VALE_TARGET="README.md docs/concepts"
This command will lint all Markdown files and check them for style issues using the Docker container
make check
Same as make dockercheck but runs locally. Requires vale to be installed.
Documentation platform development
make shell
Use this command to interactively (and temporarily!) change the contents or configuration of the live documentation container image (for example, when experimenting with new plugins).