Skip to content

Commit

Permalink
Merge branch 'main' into release-please--branches--main--components--…
Browse files Browse the repository at this point in the history
…kurtosis
  • Loading branch information
h4ck3rk3y authored Sep 19, 2023
2 parents 8c2236e + 022116a commit ff6db87
Show file tree
Hide file tree
Showing 24 changed files with 378 additions and 70 deletions.
12 changes: 12 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,10 @@ jobs:
- run: |
skip_docker_image_building=true
core/files_artifacts_expander/scripts/build.sh "${skip_docker_image_building}"
- run: |
skip_docker_image_building=true
build_architecture=arm64
core/files_artifacts_expander/scripts/build.sh "${skip_docker_image_building}" "${build_architecture}"
- run: |
set -euo pipefail
source core/files_artifacts_expander/scripts/_constants.env
Expand Down Expand Up @@ -980,6 +984,10 @@ jobs:
- run: |
skip_docker_image_building=true
core/server/scripts/build.sh "${skip_docker_image_building}"
- run: |
skip_docker_image_building=true
build_architecture=arm64
core/server/scripts/build.sh "${skip_docker_image_building}" "${build_architecture}"
- run: |
set -euo pipefail
source core/server/scripts/_constants.env
Expand Down Expand Up @@ -1019,6 +1027,10 @@ jobs:
- run: |
skip_docker_image_building=true
engine/server/scripts/build.sh "${skip_docker_image_building}"
- run: |
skip_docker_image_building=true
build_architecture=arm64
engine/server/scripts/build.sh "${skip_docker_image_building}" "${build_architecture}"
- run: |
set -euo pipefail
source engine/server/scripts/_constants.env
Expand Down
4 changes: 3 additions & 1 deletion core/files_artifacts_expander/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ FROM alpine:3.17

RUN apk update && apk add tar

ARG TARGETARCH

WORKDIR /run

COPY ./build/files-artifacts-expander ./
COPY ./build/files-artifacts-expander.$TARGETARCH ./files-artifacts-expander

CMD ./files-artifacts-expander
8 changes: 7 additions & 1 deletion core/files_artifacts_expander/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ source "${script_dirpath}/_constants.env"
BUILD_DIRNAME="build"

DEFAULT_SKIP_DOCKER_IMAGE_BUILDING=false
DEFAULT_ARCHITECTURE_TO_BUILD=amd64

MAIN_GO_FILEPATH="${expander_root_dirpath}/main.go"
MAIN_BINARY_OUTPUT_FILENAME="files-artifacts-expander"
Expand All @@ -28,6 +29,11 @@ if [ "${skip_docker_image_building}" != "true" ] && [ "${skip_docker_image_build
echo "Error: Invalid skip-docker-image-building arg '${skip_docker_image_building}'" >&2
fi

architecture_to_build="${2:-"${DEFAULT_ARCHITECTURE_TO_BUILD}"}"
if [ "${architecture_to_build}" != "amd64" ] && [ "${architecture_to_build}" != "arm64" ]; then
echo "Error: Invalid architecture-to-build arg '${architecture_to_build}'" >&2
fi

# Checks if dockerignore file is in the root path
if ! [ -f "${expander_root_dirpath}"/.dockerignore ]; then
echo "Error: No .dockerignore file found in files artifacts expander root '${expander_root_dirpath}'; this is required so Docker caching is enabled and the image builds remain quick" >&2
Expand All @@ -48,7 +54,7 @@ echo "Tests succeeded"

# Build binary for packaging inside an Alpine Linux image
echo "Building files artifacts expander main.go '${MAIN_GO_FILEPATH}'..."
if ! CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "${MAIN_BINARY_OUTPUT_FILEPATH}" "${MAIN_GO_FILEPATH}"; then
if ! CGO_ENABLED=0 GOOS=linux GOARCH=${architecture_to_build} go build -o "${MAIN_BINARY_OUTPUT_FILEPATH}.${architecture_to_build}" "${MAIN_GO_FILEPATH}"; then
echo "Error: An error occurred building the files artifacts expander code" >&2
exit 1
fi
Expand Down
4 changes: 3 additions & 1 deletion core/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ FROM alpine:3.17
# We need protobut-dev to run protobuf compiler against startosis .proto files
RUN apk update && apk add --no-cache bash protobuf-dev

ARG TARGETARCH

WORKDIR /run

COPY ./build/api-container ./
COPY ./build/api-container.$TARGETARCH ./api-container

CMD ./api-container
8 changes: 7 additions & 1 deletion core/server/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ source "${script_dirpath}/_constants.env"
BUILD_DIRNAME="build"

DEFAULT_SKIP_DOCKER_IMAGE_BUILDING=false
DEFAULT_ARCHITECTURE_TO_BUILD=amd64

MAIN_DIRNAME="api_container"
MAIN_GO_FILEPATH="${server_root_dirpath}/${MAIN_DIRNAME}/main.go"
Expand All @@ -27,6 +28,11 @@ if [ "${skip_docker_image_building}" != "true" ] && [ "${skip_docker_image_build
echo "Error: Invalid skip-docker-image-building arg '${skip_docker_image_building}'" >&2
fi

architecture_to_build="${2:-"${DEFAULT_ARCHITECTURE_TO_BUILD}"}"
if [ "${architecture_to_build}" != "amd64" ] && [ "${architecture_to_build}" != "arm64" ]; then
echo "Error: Invalid architecture-to-build arg '${architecture_to_build}'" >&2
fi

# Checks if dockerignore file is in the root path
if ! [ -f "${server_root_dirpath}"/.dockerignore ]; then
echo "Error: No .dockerignore file found in server root '${server_root_dirpath}'; this is required so Docker caching is enabled and the image builds remain quick" >&2
Expand All @@ -47,7 +53,7 @@ echo "Tests succeeded"

# Build binary for packaging inside an Alpine Linux image
echo "Building server main.go '${MAIN_GO_FILEPATH}'..."
if ! CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "${MAIN_BINARY_OUTPUT_FILEPATH}" "${MAIN_GO_FILEPATH}"; then
if ! CGO_ENABLED=0 GOOS=linux GOARCH=${architecture_to_build} go build -o "${MAIN_BINARY_OUTPUT_FILEPATH}.${architecture_to_build}" "${MAIN_GO_FILEPATH}"; then
echo "Error: An error occurred building the server code" >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/explanations/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ For day-to-day operation, we also provide [a CLI][cli-reference]. This is simply
[enclave-ls-reference]: ../cli-reference/enclave-ls.md
[enclave-inspect-reference]: ../cli-reference/enclave-inspect.md
[enclave-rm-reference]: ../cli-reference/enclave-rm.md
[quickstart]: ../get-started/quickstart.md
[quickstart]: ../get-started/quickstart-consumer.md
[sdk-reference]: ../runtime-sdk-reference.md
2 changes: 1 addition & 1 deletion docs/docs/explanations/why-kurtosis-starlark.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ So far, both our users and our team have been very happy with our decision to go
[reusable-environment-definitions]: ./reusable-environment-definitions.md
[starlark-differences-with-python]: https://bazel.build/rules/language#differences_with_python

[quickstart]: ../get-started/quickstart.md
[quickstart]: ../get-started/quickstart-consumer.md
2 changes: 1 addition & 1 deletion docs/docs/explanations/why-we-built-kurtosis.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ In our vision, a developer should have a single platform for prototyping, testin
To read more about our beliefs on reusable environments, [go here][reusable-environment-definitions]. To get started using Kurtosis, see [the quickstart][quickstart].

[reusable-environment-definitions]: ./reusable-environment-definitions.md
[quickstart]: ../get-started/quickstart.md
[quickstart]: ../get-started/quickstart-consumer.md
6 changes: 3 additions & 3 deletions docs/docs/get-started/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ sidebar_position: 1
hide_table_of_contents: true
---
## What is Kurtosis?
[Kurtosis](https://www.kurtosis.com) is a composable build system for multi-container test environments. Kurtosis makes it easier for developers to set up test environments that require dynamic setup logic (e.g. passing IPs or runtime-generated data between services) or programmatic data seeding.
[Kurtosis](https://www.kurtosis.com) is a composable build system for multi-container environments. Kurtosis makes it easier for developers to set up environments that require dynamic setup logic (e.g. passing IPs or runtime-generated data between services) or programmatic data seeding.

Go [here](../explanations/why-we-built-kurtosis.md) to learn more about what inspired us to build Kurtosis.

## Why use Kurtosis?

Developers usually set up these types of dynamic environments with a free-form scripting language like bash or Python, interacting with the Docker CLI or Docker Compose. Kurtosis is designed to make these setups easier to maintain and reuse in different test scenarios.

In Kurtosis, test environments have these properties:
In Kurtosis, containerized environments have these properties:
- Environment-level portability: the entire test environment always runs the same way, regardless of the host machine
- Composability: environments can be composed and connected together without needing to know the inner details of each setup
- Parameterizability: environments can be parameterized, so that they're easy to modify for use across different test scenarios
Expand All @@ -37,7 +37,7 @@ In Kurtosis, test environments have these properties:

## Try out Kurtosis now

Try Kurtosis now with our [quickstart](./quickstart.md).
Try Kurtosis now with our [quickstart](./quickstart-consumer.md).

:::info
If you have questions, need help, or simply want to learn more, schedule a live session with us, go [here](https://calendly.com/d/zgt-f2c-66p/kurtosis-onboarding).
Expand Down
Loading

0 comments on commit ff6db87

Please sign in to comment.