-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Batuhan Apaydin <batuhan.apaydin@chainguard.dev>
- Loading branch information
1 parent
e8793ee
commit 99d3931
Showing
9 changed files
with
321 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!--monopod:start--> | ||
# jitsucom-jitsu | ||
| | | | ||
| - | - | | ||
| **OCI Reference** | `cgr.dev/chainguard/jitsucom-jitsu` | | ||
|
||
|
||
* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/jitsucom-jitsu/overview/) | ||
* [View Image Catalog](https://console.enforce.dev/images/catalog) for a full list of available tags. | ||
* [Contact Chainguard](https://www.chainguard.dev/chainguard-images) for enterprise support, SLAs, and access to older tags.* | ||
|
||
--- | ||
<!--monopod:end--> | ||
|
||
<!--overview:start--> | ||
Jitsu is an open-source Segment alternative. Fully-scriptable data ingestion engine for modern data teams. Set-up a real-time data pipeline in minutes, not days | ||
<!--overview:end--> | ||
|
||
<!--getting:start--> | ||
## Download this Image | ||
The image is available on `cgr.dev`: | ||
|
||
``` | ||
docker pull cgr.dev/chainguard/jitsucom-jitsu:latest | ||
``` | ||
<!--getting:end--> | ||
|
||
<!--body:start--> | ||
|
||
## Usage | ||
|
||
There is no official Helm chart providied for Jitsu, but you can use the following Helm chart to deploy Jitsu on your Kubernetes cluster. | ||
|
||
Here is the issue that they discussed: https://github.com/jitsucom/jitsu/issues/880 | ||
|
||
And here is the Helm chart that you can use: https://github.com/stafftastic/jitsu-chart | ||
|
||
which is the Helm chart we used to deploy Jitsu on Kubernetes during the tests. | ||
|
||
|
||
```yaml | ||
$ helm install jitsu oci://registry-1.docker.io/stafftasticcharts/jitsu -f-<<EOF | ||
console: | ||
image: | ||
repository: cgr.dev/chainguard/jitsucom-jitsu-console | ||
tag: latest | ||
pullPolicy: IfNotPresent | ||
rotor: | ||
image: | ||
repository: cgr.dev/chainguard/jitsucom-jitsu-rotor | ||
tag: latest | ||
pullPolicy: IfNotPresent | ||
EOF | ||
``` | ||
|
||
<!--body:end--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
contents: | ||
packages: [ | ||
"busybox", | ||
] | ||
|
||
accounts: | ||
groups: | ||
- groupname: nonroot | ||
gid: 65532 | ||
users: | ||
- username: nonroot | ||
uid: 65532 | ||
gid: 65532 | ||
run-as: 65532 | ||
|
||
paths: | ||
- path: /app/ | ||
type: directory | ||
permissions: 0o777 | ||
gid: 65532 | ||
|
||
# Currently there are some packages required that are only available in | ||
# the x86_64 variety. | ||
archs: | ||
- x86_64 | ||
|
||
environment: | ||
NODE_ENV: production | ||
|
||
entrypoint: | ||
command: sh -c "/app/docker-start-console.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
terraform { | ||
required_providers { | ||
apko = { source = "chainguard-dev/apko" } | ||
} | ||
} | ||
|
||
variable "extra_packages" { | ||
description = "The additional packages to install" | ||
default = [] | ||
} | ||
|
||
variable "name" { | ||
description = "The name of the component" | ||
default = "console" | ||
} | ||
|
||
data "apko_config" "this" { | ||
config_contents = file("${path.module}/${var.name}/template.apko.yaml") | ||
extra_packages = var.extra_packages | ||
} | ||
|
||
output "config" { | ||
value = jsonencode(data.apko_config.this.config) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
contents: | ||
packages: [ | ||
"busybox", | ||
] | ||
|
||
accounts: | ||
groups: | ||
- groupname: nonroot | ||
gid: 65532 | ||
users: | ||
- username: nonroot | ||
uid: 65532 | ||
gid: 65532 | ||
run-as: 65532 | ||
|
||
# Currently there are some packages required that are only available in | ||
# the x86_64 variety. | ||
archs: | ||
- x86_64 | ||
|
||
environment: | ||
NODE_ENV: production | ||
|
||
work-dir: /app | ||
|
||
entrypoint: | ||
command: /usr/local/bin/docker-entrypoint.sh | ||
|
||
cmd: --no-node-snapshot --max-old-space-size=2048 main.js |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
} | ||
} | ||
|
||
locals { | ||
components = toset([ | ||
"console", | ||
"rotor", | ||
]) | ||
} | ||
|
||
variable "target_repository" { | ||
description = "The docker repo into which the image and attestations should be published." | ||
} | ||
|
||
module "config" { | ||
for_each = local.components | ||
source = "./configs" | ||
name = each.key | ||
extra_packages = ["jitsucom-jitsu-${each.key}"] | ||
} | ||
|
||
module "jitsucom-jitsu" { | ||
for_each = local.components | ||
source = "../../tflib/publisher" | ||
name = basename(path.module) | ||
target_repository = "${var.target_repository}-${each.key}" | ||
config = module.config[each.key].config | ||
|
||
build-dev = true | ||
main_package = "jitsucom-jitsu-${each.key}" | ||
} | ||
|
||
module "test" { | ||
source = "./tests" | ||
digests = { for k, v in module.jitsucom-jitsu : k => v.image_ref } | ||
} | ||
|
||
resource "oci_tag" "latest" { | ||
for_each = local.components | ||
depends_on = [module.test] | ||
digest_ref = module.jitsucom-jitsu[each.key].image_ref | ||
tag = "latest" | ||
} | ||
|
||
resource "oci_tag" "latest-dev" { | ||
for_each = local.components | ||
depends_on = [module.test] | ||
digest_ref = module.jitsucom-jitsu[each.key].dev_ref | ||
tag = "latest-dev" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: jitsucom-jitsu | ||
image: cgr.dev/chainguard/jitsucom-jitsu | ||
logo: https://storage.googleapis.com/chainguard-academy/logos/jitsucom-jitsu.svg | ||
endoflife: "" | ||
console_summary: "" | ||
short_description: Jitsu is an open-source Segment alternative. Fully-scriptable data ingestion engine for modern data teams. Set-up a real-time data pipeline in minutes, not days | ||
compatibility_notes: "" | ||
readme_file: README.md | ||
upstream_url: https://github.com/jitsucom/jitsu | ||
keywords: | ||
- jitsu | ||
- application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
terraform { | ||
required_providers { | ||
oci = { source = "chainguard-dev/oci" } | ||
imagetest = { source = "chainguard-dev/imagetest" } | ||
} | ||
} | ||
|
||
variable "digests" { | ||
description = "The image digest to run tests over." | ||
type = object({ | ||
console = string | ||
rotor = string | ||
}) | ||
} | ||
|
||
data "oci_string" "ref" { | ||
for_each = var.digests | ||
input = each.value | ||
} | ||
|
||
data "imagetest_inventory" "this" {} | ||
|
||
resource "imagetest_harness_k3s" "this" { | ||
name = "jitsucom-bulker" | ||
inventory = data.imagetest_inventory.this | ||
|
||
sandbox = { | ||
mounts = [ | ||
{ | ||
source = path.module | ||
destination = "/tests" | ||
} | ||
] | ||
} | ||
} | ||
|
||
module "helm" { | ||
source = "../../../tflib/imagetest/helm" | ||
|
||
name = "jitsucom-jitsu" | ||
namespace = "jitsucom-jitsu" | ||
chart = "oci://registry-1.docker.io/stafftasticcharts/jitsu" | ||
|
||
values = { | ||
console = { | ||
image = { | ||
repository = data.oci_string.ref["console"].registry_repo | ||
tag = data.oci_string.ref["console"].pseudo_tag | ||
} | ||
} | ||
rotor = { | ||
image = { | ||
repository = data.oci_string.ref["rotor"].registry_repo | ||
tag = data.oci_string.ref["rotor"].pseudo_tag | ||
} | ||
} | ||
tokenGenerator = { | ||
image = { | ||
tag = "1.30.0" # Latest is not exist. | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource "imagetest_feature" "basic" { | ||
name = "Basic" | ||
description = "Basic Helm install for jitsucom-jitsu" | ||
harness = imagetest_harness_k3s.this | ||
|
||
steps = [ | ||
{ | ||
name = "Helm install" | ||
cmd = module.helm.install_cmd | ||
}, | ||
{ | ||
name = "Display logs" | ||
cmd = <<EOF | ||
echo "Logs for jitsucom-jitsu-console" | ||
kubectl logs deploy/jitsucom-jitsu-console -n jitsucom-jitsu | ||
kubectl logs deploy/jitsucom-jitsu-console -n jitsucom-jitsu | grep -i "HEALTHCHECK PASSED - 200" | ||
echo "Logs for jitsucom-jitsu-rotor" | ||
kubectl logs deploy/jitsucom-jitsu-rotor -n jitsucom-jitsu | ||
kubectl logs deploy/jitsucom-jitsu-rotor -n jitsucom-jitsu | grep -i "Listening on port 3401" | ||
exit 1 | ||
EOF | ||
} | ||
] | ||
|
||
labels = { | ||
type = "k8s" | ||
} | ||
} |