Skip to content

Commit

Permalink
Merge pull request #1689 from dataform-co/remove-rules-docker
Browse files Browse the repository at this point in the history
Remove rules docker
  • Loading branch information
Ekrekr authored Mar 25, 2024
2 parents bd5360b + 7807983 commit 6e6c36e
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 151 deletions.
67 changes: 0 additions & 67 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -96,65 +96,6 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

gazelle_dependencies()

# Docker base images.
http_archive(
name = "io_bazel_rules_docker",
sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
)

load(
"@io_bazel_rules_docker//toolchains/docker:toolchain.bzl",
docker_toolchain_configure = "toolchain_configure",
)

# Force Docker toolchain to use 'which' to find Docker binary.
docker_toolchain_configure(
name = "docker_config",
)

load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)

container_repositories()

load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")

container_deps()

load("@io_bazel_rules_docker//repositories:py_repositories.bzl", "py_deps")

py_deps()

load(
"@io_bazel_rules_docker//container:container.bzl",
"container_pull",
)

container_pull(
name = "nodejs_base",
# This digest is for tag "18.13.0".
digest = "sha256:d9061fd0205c20cd47f70bdc879a7a84fb472b822d3ad3158aeef40698d2ce36",
registry = "index.docker.io",
repository = "library/node",
)

container_pull(
name = "nginx_base",
digest = "sha256:8c3cdb5acd050a5a46be0bb5637e23d192f4ef010b4fb6c5af40e45c5b7a0a71",
registry = "index.docker.io",
repository = "library/nginx",
)

load(
"@io_bazel_rules_docker//nodejs:image.bzl",
_nodejs_image_repos = "repositories",
)

_nodejs_image_repos()

# Gcloud SDK binaries.
load("//tools/gcloud:repository_rules.bzl", "gcloud_sdk")

Expand Down Expand Up @@ -185,11 +126,3 @@ go_repository(
sum = "h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=",
version = "v0.3.2",
)

container_pull(
name = "debian_base",
# docker manifest inspect index.docker.io/debian:bullseye
digest = "sha256:c11d2593cb741ae8a36d0de9cd240d13518e95f50bccfa8d00a668c006db181e",
registry = "index.docker.io",
repository = "library/debian",
)
34 changes: 1 addition & 33 deletions cli/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
load("//tools:ts_library.bzl", "ts_library")
load("//tools/common:copy.bzl", "copy_file")
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push")
load("@io_bazel_rules_docker//docker/util:run.bzl", "container_run_and_commit")
load("//:version.bzl", "DF_VERSION")
load("//testing:index.bzl", "ts_test_suite")
load("//tools:node_modules.bzl", "node_modules")
Expand Down Expand Up @@ -49,8 +47,8 @@ ts_test_suite(
srcs = ["index_test.ts"],
data = [
":node_modules",
"//test_credentials:bigquery.json",
"//packages/@dataform/core:package_tar",
"//test_credentials:bigquery.json",
"@nodejs//:node",
"@nodejs//:npm",
],
Expand All @@ -73,33 +71,3 @@ copy_file(
src = "//:readme.md",
out = "readme.md",
)

container_run_and_commit(
name = "image_with_dataform_cli",
commands = [
"npm i -g @dataform/cli@{dataform_version}".format(dataform_version = DF_VERSION),
],
image = "@nodejs_base//image",
tags = [
"no-remote",
],
)

container_image(
name = "image_with_dataform_entrypoint",
base = ":image_with_dataform_cli_commit.tar",
cmd = [],
entrypoint = ["dataform"],
tags = [
"no-remote",
],
)

container_push(
name = "push",
format = "Docker",
image = ":image_with_dataform_entrypoint",
registry = "docker.io",
repository = "dataformco/dataform",
tag = DF_VERSION,
)
2 changes: 1 addition & 1 deletion cli/index_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ suite("@dataform/cli", ({ afterEach }) => {
const nodePath = `external/${platformPath}/bin/node`;
const cliEntryPointPath = "cli/node_modules/@dataform/cli/bundle.js";
const npmPath = `external/${platformPath}/bin/npm`;
const corePackageTarPath = "packages/@dataform/core/package.tgz";
const corePackageTarPath = "packages/@dataform/core/package.tar.gz";

test(
"compile throws an error when dataformCoreVersion not in workflow_settings.yaml and no " +
Expand Down
4 changes: 2 additions & 2 deletions cloudbuild-test.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"steps": [
{
"name": "gcr.io/dataform-public/dataform-builder@sha256:413b7e076ae77f1bed9b254434919e40d4d4112c00e1a12ea076da112a7012e9",
"name": "gcr.io/cloud-builders/bazel:5.4.0",
"entrypoint": "bash",
"args": ["./scripts/cloudbuild/bazel_test"]
"args": ["./scripts/run_tests"]
}
],
"timeout": "3600s",
Expand Down
37 changes: 0 additions & 37 deletions cloudbuild/BUILD

This file was deleted.

1 change: 0 additions & 1 deletion packages/@dataform/cli/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,5 @@ pkg_npm_tar(
":bundle",
":package.json",
":worker_bundle",

],
)
4 changes: 2 additions & 2 deletions packages/index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def pkg_npm_tar(name, srcs = [], deps = []):
native.genrule(
name = name + "_tar",
srcs = [":" + name],
outs = [name + ".tgz"],
cmd = "tar -cvzf $(location {name}.tgz) -C $(location :{name})/.. --dereference {name}"
outs = [name + ".tar.gz"],
cmd = "tar -cvzf $(location {name}.tar.gz) -C $(location :{name})/.. --dereference {name}"
.format(name = name),
)

Expand Down
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ npm i -g @dataform/cli
- Write [data quality checks](https://cloud.google.com/dataform/docs/assertions).
- Enable [scripting](https://cloud.google.com/dataform/docs/develop-workflows-js) and code re-use with a JavaScript API.
- Import [pre-defined packages](https://dataform-co.github.io/dataform/docs/packages), or create your own.
- Import [pre-defined packages](https://dataform-co.github.io/dataform/docs/packages), or create your own.
- View the [Dataform Core reference](https://cloud.google.com/dataform/docs/reference/dataform-core-reference).
- View the [Dataform configs reference](docs/configs-reference).
- View the [Dataform configs reference](https://dataform-co.github.io/dataform/docs/configs-reference).

_Note: this readme can also be viewed on https://dataform-co.github.io/dataform._

Expand Down
5 changes: 0 additions & 5 deletions scripts/publish
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ echo "Publishing as '$TAG' based on version: $VERSION"

bazel run packages/@dataform/cli:package.publish -- --tag=$TAG
bazel run packages/@dataform/core:package.publish -- --tag=$TAG
bazel run cli:push

git tag $VERSION
git push origin $VERSION

docker pull dataformco/dataform:$VERSION
docker tag dataformco/dataform:$VERSION dataformco/dataform:$TAG
docker push dataformco/dataform:$TAG
File renamed without changes.
2 changes: 1 addition & 1 deletion version.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# NOTE: If you change the format of this line, you must change the bash command
# in /scripts/publish to extract the version string correctly.
DF_VERSION = "3.0.0-beta.1"
DF_VERSION = "3.0.0-beta.2"

0 comments on commit 6e6c36e

Please sign in to comment.