Skip to content

Commit

Permalink
add jitsucom-bulker image: bulker, ingest, syncctl
Browse files Browse the repository at this point in the history
Signed-off-by: Furkan Türkal <furkan.turkal@chainguard.dev>
  • Loading branch information
Dentrax committed May 6, 2024
1 parent 63c17ff commit 7a554e8
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 0 deletions.
9 changes: 9 additions & 0 deletions generated.tf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions images/jitsucom-bulker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--monopod:start-->
# jitsucom-bulker
| | |
| - | - |
| **OCI Reference** | `cgr.dev/chainguard/jitsucom-bulker` |


* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/jitsucom-bulker/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-->
Service for bulk-loading data to databases with automatic schema management (Redshift, Snowflake, BigQuery, ClickHouse, Postgres, MySQL)
<!--overview:end-->

<!--getting:start-->
## Download this Image
The image is available on `cgr.dev`:

```
docker pull cgr.dev/chainguard/jitsucom-bulker:latest
```
<!--getting:end-->

<!--body:start--><!--body:end-->
24 changes: 24 additions & 0 deletions images/jitsucom-bulker/config/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
variable "extra_packages" {
description = "Additional packages to install."
type = list(string)
default = [""]
}

variable "main_package" {
description = "The main package to install."
type = string
}

module "accts" { source = "../../../tflib/accts" }

output "config" {
value = jsonencode({
contents = {
packages = concat(["jitsucom-bulker-${var.main_package}", "jitsucom-bulker-${var.main_package}-compat"], var.extra_packages)
}
accounts = module.accts.block
entrypoint = {
command = "/app/${var.main_package}"
}
})
}
13 changes: 13 additions & 0 deletions images/jitsucom-bulker/generated.tf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions images/jitsucom-bulker/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
}
}

variable "target_repository" {
description = "The docker repo into which the image and attestations should be published."
}

locals {
components = toset(["bulker", "ingest", "syncctl"])
}

module "config" {
for_each = local.components
source = "./config"
main_package = each.key
}

module "latest" {
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
}

module "test" {
source = "./tests"
digests = { for k, v in module.latest : k => v.image_ref }
}

resource "oci_tag" "latest" {
for_each = local.components

digest_ref = module.latest[each.key].image_ref
tag = "latest"
depends_on = [module.test]
}

resource "oci_tag" "latest-dev" {
for_each = local.components

digest_ref = module.latest[each.key].dev_ref
tag = "latest-dev"
depends_on = [module.test]
}
12 changes: 12 additions & 0 deletions images/jitsucom-bulker/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: jitsucom-bulker
image: cgr.dev/chainguard/jitsucom-bulker
logo: https://storage.googleapis.com/chainguard-academy/logos/jitsucom-bulker.svg
endoflife: ""
console_summary: "Bulker is a tool for streaming and batching large amount of semi-structured data into data warehouses."
short_description: Service for bulk-loading data to databases with automatic schema management (Redshift, Snowflake, BigQuery, ClickHouse, Postgres, MySQL)
compatibility_notes: ""
readme_file: README.md
upstream_url: https://github.com/jitsucom/bulker
keywords:
- application
- kafka
82 changes: 82 additions & 0 deletions images/jitsucom-bulker/tests/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
imagetest = { source = "chainguard-dev/imagetest" }
}
}

variable "digests" {
description = "The image digests to run tests over."
type = object({
bulker = string
ingest = string
syncctl = 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-bulker"
namespace = "jitsucom-bulker"
chart = "oci://registry-1.docker.io/stafftasticcharts/jitsu"

values = {
bulker = {
image = {
repository = data.oci_string.ref["bulker"].registry_repo
tag = data.oci_string.ref["bulker"].pseudo_tag
}
}
ingest = {
image = {
repository = data.oci_string.ref["ingest"].registry_repo
tag = data.oci_string.ref["ingest"].pseudo_tag
}
}
syncctl = {
image = {
repository = data.oci_string.ref["syncctl"].registry_repo
tag = data.oci_string.ref["syncctl"].pseudo_tag
}
}
}
}

resource "imagetest_feature" "basic" {
name = "Basic"
description = "Basic Helm install for bank-vaults"
harness = imagetest_harness_k3s.this

steps = [
{
name = "Helm install"
cmd = module.helm.install_cmd
}
]

labels = {
type = "k8s"
}
}
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ module "harbor" {
target_repository = "${var.target_repository}/harbor"
}

module "jitsucom-bulker" {
source = "./images/jitsucom-bulker"
target_repository = "${var.target_repository}/jitsucom-bulker"
}

module "k3s" {
source = "./images/k3s"
target_repository = "${var.target_repository}/k3s"
Expand Down

0 comments on commit 7a554e8

Please sign in to comment.