Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kanisterio/kanister into kanx-2-k…
Browse files Browse the repository at this point in the history
…ubexec-C
  • Loading branch information
aaron-kasten committed Jan 14, 2025
2 parents a44662d + c765fb7 commit 4f77b4e
Show file tree
Hide file tree
Showing 98 changed files with 116 additions and 5,926 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/atlas-image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # v45.0.4
- uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
name: Get changed files
id: changed-files
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
-
# Upload the results to GitHub's code scanning dashboard.
name: "Upload to results to dashboard"
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
sarif_file: results.sarif
-
name: "Upload analysis results as 'Job Artifact'"
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: SARIF file
path: results.sarif
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: pnpm/action-setup@v4
with:
run_install: false
package_json_file: docs_new/package.json
package_json_file: docs/package.json
version: 8
- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -39,16 +39,16 @@ jobs:
uses: actions/configure-pages@v5
- name: Install dependencies
run: pnpm install
working-directory: ./docs_new
working-directory: ./docs
- name: Build with VitePress
run: |
echo "{\"version\":\"${RELEASE_TAG}\"}" > ./.vitepress/version.json
pnpm docs:build
working-directory: ./docs_new
working-directory: ./docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs_new/.vitepress/dist
path: docs/.vitepress/dist
name: docs

publish_docs:
Expand Down
31 changes: 11 additions & 20 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,31 +193,15 @@ make integration-test openshift ocp_version=4.13

## Documentation

The source of the documentation is found in the `docs` folder. They are written
in the [reStructuredText](https://docutils.sourceforge.io/rst.html) format.

To rebuild the documentation:

```sh
make docs
```

The `docs` target uses the `ghcr.io/kanisterio/docker-sphinx` public image to
generate the HTML documents and store them in your local `/docs/_build/html`
folder.

## New Documentation

We have started experimenting, and will soon fully transition, to using
[VitePress](https://vitepress.dev/) to generate Kanister documentation.
We use [VitePress](https://vitepress.dev/) to generate Kanister documentation.
This requires the documentation files to be written in
[Markdown](https://www.markdownguide.org/), along with some
[extensions](https://vitepress.dev/guide/markdown).

This new documentation system offers a live-dev server that will dynamically
This documentation system offers a live-dev server that will dynamically
render Markdown documentation files as you are making changes to them on your
local machine/branch.
To start this development server, place yourself in the `docs_new` folder, then
To start this development server, place yourself in the `docs` folder, then
run the following commands:

```sh
Expand All @@ -231,6 +215,13 @@ pages, Javascript/CSS files, etc.), use this command:
pnpm run docs:build
```

Alternatively to build docs using a docker container, you can run:
```sh
make docs
```

This will create the `docs/.vitepress/dist` folder with html docs there.

To start a local webserver that you can use to preview the documentation that
has been rendered by the command above, use this command:
```sh
Expand All @@ -252,7 +243,7 @@ written in Go. They are located in the `pkg/function` folder.
Take a look at this [PR](https://github.com/kanisterio/kanister/pull/1282) to
see how to write a new Kanister Function.

Don't forget to update the documentation at `docs/functions.rst` with
Don't forget to update the documentation at `docs/functions.md` with
configuration information and examples to show off your new function.

## Build Kanister image
Expand Down
1 change: 0 additions & 1 deletion CODE_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Pull request process is described in [contributing guide](./CONTRIBUTING.md#subm
- Reviewer should request changes from contributor to add tests
- If change in the PR needs documentation
- Reviewer should request new docs or update to existing docs
- `/docs` and `/docs_new` need to be kept in sync until we deprecate `/docs`
- If PR introduces breaking changes, fixes a bug or adds a new feature, there should be a [release note](#release-notes)
- Reviewer may request changes from the contributor to add a release note
- Reviewer may add a release note by themself in order to unblock the merge process
Expand Down
28 changes: 1 addition & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,8 @@ golint:
codegen:
@$(MAKE) run CMD="./build/codegen.sh"

DOCS_CMD = "cd docs && make clean && \
doc8 --max-line-length 90 --ignore D000 . && \
make spelling && make html"

docs:
ifeq ($(DOCKER_BUILD),"true")
@echo "running DOCS_CMD in the containerized build environment"
@PWD=$(PWD) ARCH=$(ARCH) CMD=$(DOCS_CMD) /bin/bash ./build/run_container.sh docs
else
@/bin/bash -c $(DOCS_CMD)
endif
@$(MAKE) run BUILD_IMAGE="node:20-slim" CMD="VERSION=$(VERSION) ./build/build_docs.sh"

API_DOCS_CMD = "gen-crd-api-reference-docs \
-config docs/api_docs/config.json \
Expand Down Expand Up @@ -227,23 +218,6 @@ dotfile-clean:
bin-clean:
rm -rf .go bin

release-docs: docs
@if [ -z ${AWS_ACCESS_KEY_ID} ] || [ -z ${AWS_SECRET_ACCESS_KEY} ]; then\
echo "Please set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Exiting.";\
exit 1;\
fi;\

@if [ -f "docs/_build/html/index.html" ]; then\
aws s3 sync docs/_build/html $(DOCS_RELEASE_BUCKET) --delete;\
echo "Success";\
else\
echo "No built docs found";\
exit 1;\
fi;\

release-helm:
@/bin/bash ./build/release_helm.sh $(VERSION)

package-helm:
@$(MAKE) run CMD="PACKAGE_FOLDER=${PACKAGE_FOLDER} HELM_RELEASE_REPO_URL=${HELM_RELEASE_REPO_URL} HELM_RELEASE_REPO_INDEX=${HELM_RELEASE_REPO_INDEX} ./build/package_helm.sh $(VERSION)"

Expand Down
17 changes: 17 additions & 0 deletions build/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -o errexit
set -o xtrace

cd docs

if [[ -z ${VERSION} ]]
then
echo "{\"version\":\"${VERSION}\"}" > ./.vitepress/version.json
fi

npm install -g pnpm

pnpm cache clean
pnpm install --force
pnpm docs:build
69 changes: 0 additions & 69 deletions build/release_helm.sh

This file was deleted.

12 changes: 0 additions & 12 deletions build/run_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ set -o nounset

PWD="${PWD:-$(pwd)}"

DOCS_BUILD_IMAGE="${DOCS_BUILD_IMAGE:-ghcr.io/kanisterio/docker-sphinx:0.2.0}"
BUILD_IMAGE="${BUILD_IMAGE:-ghcr.io/kanisterio/build:latest}"
PKG="${PKG:-github.com/kanisterio/kanister}"

Expand Down Expand Up @@ -104,13 +103,6 @@ shell() {
EXTRA_PARAMS="-ti" run_build_container
}

docs() {
check_param "CMD"

echo "Running docs container..."
IMAGE=${DOCS_BUILD_IMAGE} run_docs_container
}

crd_docs() {
check_param "CMD"

Expand All @@ -124,7 +116,6 @@ Usage: ${0} <operation>
Where operation is one of the following:
build: run some command within a build container
crd_docs: build API docs within a container
docs: build docs within a container
shell: run build container in interactive shell mode
EOM
exit 1
Expand All @@ -136,9 +127,6 @@ case "${1}" in
crd_docs)
time -p crd_docs
;;
docs)
time -p docs
;;
run)
time -p run
;;
Expand Down
16 changes: 0 additions & 16 deletions docker/docs-build/Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions docker/postgres-kanister-tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
awscli==1.36.34
awscli==1.36.39
pip==24.3.1
setuptools==75.7.0
setuptools==75.8.0
wheel==0.45.1
4 changes: 2 additions & 2 deletions docker/postgresql/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
awscli==1.36.34
awscli==1.36.39
wal-e==1.1.1
pip==24.3.1
setuptools==75.7.0
setuptools==75.8.0
wheel==0.45.1
4 changes: 3 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
_build*
node_modules/
.vitepress/cache/
.vitepress/dist/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

Loading

0 comments on commit 4f77b4e

Please sign in to comment.