From d8a1257cfc0701e87133e698f1b28ab4acbeebb7 Mon Sep 17 00:00:00 2001 From: andream16 Date: Wed, 11 Sep 2024 15:21:10 +0100 Subject: [PATCH] Extending docs with sections about custom container platform and OS/ARCH for building binaries. Bumping remark-cli to suppress errors and warnings on linting markdown files. --- docs/getting-started.md | 42 ++++++++++++++++++++++++++++++++++++++++- package-lock.json | 29 ++++++++++------------------ package.json | 2 +- 3 files changed, 52 insertions(+), 21 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index ce6903a55..d4b4a57c7 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -176,7 +176,8 @@ KiND cluster, that's not the case. Instead, the registry's host is deploy the pipelines and their image repositories will also have to be set to this value.* -*\*\*Make sure that you use the draconctl image that you pushed in the repository.* +*\*\*Make sure that you use the draconctl image that you pushed in the +repository.* #### Using a different base image for your images @@ -191,6 +192,45 @@ these components have their own Makefiles. In those cases you can place a `.custom_image` file in the directory with the base image you wish to use and that will be picked up by the Makefile and build the container. +#### Building binaries and images for non linux/amd64 architecture + +*\*Useful for Apple Silicon chips users.* + +###### Containers + +If you need your images to be built for non linux/amd64 architecture, +you can supply the flag `CONTAINER_OS_ARCH` for customisation of containers. + +This can be passed to the make commands used to build images, for example: + +```bash +make CONTAINER_OS_ARCH=linux/arm64 components +``` + +or: + +```bash +make CONTAINER_OS_ARCH=linux/arm64 publish-containers +``` + +By default, when `CONTAINER_ARCH` is not supplied, `linux/amd64` is used. + +###### Binaries + +`GOOS` and `GOARCH` can be supplied for customisation of the go binaries. + +These can be passed to the make commands used to build binaries, for example: + +```bash +make GOOS=linux GOARCH=arm64 component-binaries +``` + +By default `linux` and `amd64` are used. + +\**For Apple Silicon chips, you might want to use +`GOOS=darwin` and `GOARCH=arm64` when building binaries +locally for development.* + #### Deploying your custom Dracon components Helm package You can package your components into a Helm package by running the following diff --git a/package-lock.json b/package-lock.json index a7f7bfbf0..98cec1b1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,9 +4,8 @@ "requires": true, "packages": { "": { - "name": "dracon", "devDependencies": { - "remark-cli": "^12.0.0", + "remark-cli": "^12.0.1", "remark-lint-list-item-indent": "^4.0.0", "remark-lint-no-shell-dollars": "^4.0.0", "remark-preset-lint-consistent": "^6.0.0", @@ -698,10 +697,11 @@ } }, "node_modules/import-meta-resolve": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.1.1.tgz", - "integrity": "sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", + "integrity": "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -915,16 +915,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/load-plugin/node_modules/import-meta-resolve": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.0.0.tgz", - "integrity": "sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/longest-streak": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", @@ -1838,12 +1828,13 @@ } }, "node_modules/remark-cli": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/remark-cli/-/remark-cli-12.0.0.tgz", - "integrity": "sha512-IGxCo2VsXC/GS2YdlF7+S8DsUiyULyiauik01NFoiMIrOlbDhXjrKLD8hYazwQdD67nw2k7cwOBIxcK/cbNd9Q==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/remark-cli/-/remark-cli-12.0.1.tgz", + "integrity": "sha512-2NAEOACoTgo+e+YAaCTODqbrWyhMVmlUyjxNCkTrDRHHQvH6+NbrnqVvQaLH/Q8Ket3v90A43dgAJmXv8y5Tkw==", "dev": true, + "license": "MIT", "dependencies": { - "import-meta-resolve": "^3.0.0", + "import-meta-resolve": "^4.0.0", "markdown-extensions": "^2.0.0", "remark": "^15.0.0", "unified-args": "^11.0.0" diff --git a/package.json b/package.json index 386220237..1def70236 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ ] }, "devDependencies": { - "remark-cli": "^12.0.0", + "remark-cli": "^12.0.1", "remark-lint-list-item-indent": "^4.0.0", "remark-lint-no-shell-dollars": "^4.0.0", "remark-preset-lint-consistent": "^6.0.0",