Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
FortiShield committed Nov 25, 2024
1 parent cd1a5ce commit 41458de
Show file tree
Hide file tree
Showing 39 changed files with 78 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @gitpod-io/team-engine
* @khulnasoft/team-engine
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ builds:
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/gitpod-io/dazzle/cmd/core.version={{.Version}}-{{.ShortCommit}}
- -s -w -X github.com/khulnasoft/dazzle/cmd/core.version={{.Version}}-{{.ShortCommit}}
goos:
- darwin
- linux
Expand All @@ -18,7 +18,7 @@ builds:
flags:
- -tags=util
ldflags:
- -s -w -X github.com/gitpod-io/dazzle/cmd/util.version={{.Version}}-{{.ShortCommit}}
- -s -w -X github.com/khulnasoft/dazzle/cmd/util.version={{.Version}}-{{.ShortCommit}}
goos:
- darwin
- linux
Expand Down Expand Up @@ -60,6 +60,6 @@ dockers:
goarm: ''
dockerfile: Dockerfile
image_templates:
- "ghcr.io/gitpod-io/dazzle:{{ .Tag }}"
- "ghcr.io/khulnasoft/dazzle:{{ .Tag }}"
extra_files:
- README.md
4 changes: 2 additions & 2 deletions .gitpod.Dockerfile → .khulnasoft.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gitpod/workspace-full
FROM khulnasoft/workspace-full

USER root
ENV TRIGGER_REBUILD=2
Expand All @@ -8,4 +8,4 @@ RUN sudo su -c "cd /usr; curl -L https://github.com/moby/buildkit/releases/downl
# NOTE: remove when workspace-full includes golangci
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo BINDIR=/usr/local/bin sh

USER gitpod
USER khulnasoft
4 changes: 2 additions & 2 deletions .gitpod.yml → .khulnasoft.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
image:
file: .gitpod.Dockerfile
file: .khulnasoft.Dockerfile

checkoutLocation: dazzle
workspaceLocation: dazzle
tasks:
- command: sudo buildkitd --group gitpod
- command: sudo buildkitd --group khulnasoft
- command: docker run -p 5000:5000 --name registry --rm registry:2
openMode: split-right
- init: go get -v ./...
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2019 Gitpod
Copyright © 2019 Khulnasoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<img src="logo.png" width="100" style="padding: 1em; background-color: white; border-radius: 10px;">

[![Setup Automated](https://img.shields.io/badge/setup-automated-blue?logo=gitpod)](https://gitpod.io/#https://github.com/gitpod-io/dazzle)
[![Go Report Card](https://goreportcard.com/badge/github.com/gitpod-io/dazzle)](https://goreportcard.com/report/github.com/gitpod-io/dazzle)
[![Setup Automated](https://img.shields.io/badge/setup-automated-blue?logo=khulnasoft)](https://khulnasoft.io/#https://github.com/khulnasoft/dazzle)
[![Go Report Card](https://goreportcard.com/badge/github.com/khulnasoft/dazzle)](https://goreportcard.com/report/github.com/khulnasoft/dazzle)
[![Stability: Experimental](https://masterminds.github.io/stability/experimental.svg)](https://masterminds.github.io/stability/experimental.html)

dazzle is a rather experimental Docker/OCI image builder. Its goal is to build independent layers where a change to one layer does *not* invalidate the ones sitting "above" it.

**Beware** Recently the format for [dazzle builds was changed](https://github.com/gitpod-io/dazzle/commit/ceaa19ef6562e03108c8ea9474d2c627a452a7ca), moving from a single Dockerfile to one per "chunk"/layer. It is also about 5x faster, more reliable and less hacky.
**Beware** Recently the format for [dazzle builds was changed](https://github.com/khulnasoft/dazzle/commit/ceaa19ef6562e03108c8ea9474d2c627a452a7ca), moving from a single Dockerfile to one per "chunk"/layer. It is also about 5x faster, more reliable and less hacky.

## How does it work?
dazzle has three main capabilities.
Expand All @@ -31,7 +31,7 @@ For example, if you're building an image that serves as a collection of tools, t
Install and run [buildkit](https://github.com/moby/buildkit/releases) - currently 0.10.1 - in the background.
Pull and run a docker registry.

NOTE: if you are running it in Gitpod this is done for you!
NOTE: if you are running it in Khulnasoft this is done for you!

```bash
sudo su -c "cd /usr; curl -L https://github.com/moby/buildkit/releases/download/v0.10.1/buildkit-v0.10.1.linux-amd64.tar.gz | tar xvz"
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/build.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -26,7 +26,7 @@ import (
"github.com/moby/buildkit/client"
"github.com/spf13/cobra"

"github.com/gitpod-io/dazzle/pkg/dazzle"
"github.com/khulnasoft/dazzle/pkg/dazzle"
)

// buildCmd represents the build command
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/combine.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -30,7 +30,7 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/gitpod-io/dazzle/pkg/dazzle"
"github.com/khulnasoft/dazzle/pkg/dazzle"
)

// combineCmd represents the build command
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/project-add-combination.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -26,7 +26,7 @@ import (

"github.com/spf13/cobra"

"github.com/gitpod-io/dazzle/pkg/dazzle"
"github.com/khulnasoft/dazzle/pkg/dazzle"
)

var projectAddCombinationCmd = &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/project-hash.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -27,7 +27,7 @@ import (

"github.com/spf13/cobra"

"github.com/gitpod-io/dazzle/pkg/dazzle"
"github.com/khulnasoft/dazzle/pkg/dazzle"
)

var projectHashCmd = &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/project-ignore.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -26,7 +26,7 @@ import (

"github.com/spf13/cobra"

"github.com/gitpod-io/dazzle/pkg/dazzle"
"github.com/khulnasoft/dazzle/pkg/dazzle"
)

var projectIgnoreCmd = &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/project-image-name.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -26,7 +26,7 @@ import (

"github.com/spf13/cobra"

"github.com/gitpod-io/dazzle/pkg/dazzle"
"github.com/khulnasoft/dazzle/pkg/dazzle"
)

var projectImageNameOpts struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/project-init.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -27,7 +27,7 @@ import (

"github.com/spf13/cobra"

"github.com/gitpod-io/dazzle/pkg/dazzle"
"github.com/khulnasoft/dazzle/pkg/dazzle"
)

// projectInitCmd represents the version command
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/project-manifest.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -27,7 +27,7 @@ import (

"github.com/spf13/cobra"

"github.com/gitpod-io/dazzle/pkg/dazzle"
"github.com/khulnasoft/dazzle/pkg/dazzle"
)

var projectManifestCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/core/project.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -30,7 +30,7 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/gitpod-io/dazzle/pkg/fancylog"
"github.com/khulnasoft/dazzle/pkg/fancylog"
)

var rootCfg struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/core/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion cmd/util/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 11 additions & 5 deletions cmd/util/test-add.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -34,8 +34,8 @@ import (
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"

"github.com/gitpod-io/dazzle/pkg/fancylog"
"github.com/gitpod-io/dazzle/pkg/test"
"github.com/khulnasoft/dazzle/pkg/fancylog"
"github.com/khulnasoft/dazzle/pkg/test"
)

var testAddCmd = &cobra.Command{
Expand Down Expand Up @@ -159,11 +159,13 @@ func splitCommand(cmd string) ([]string, error) {
}

func addAssertions(spec *test.Spec, runres *test.RunResult) error {
// don't let log messages interfere with prompt
// Set log level to prevent log messages from interfering with the prompt
log.SetLevel(log.WarnLevel)

// Serialize stdout and stderr for display
stdout, _ := json.Marshal(string(runres.Stdout))
stderr, _ := json.Marshal(string(runres.Stderr))

fmt.Println("Available variables are:")
color.Info.Print("stdout: ")
fmt.Println(string(stdout))
Expand All @@ -173,6 +175,7 @@ func addAssertions(spec *test.Spec, runres *test.RunResult) error {
fmt.Println(runres.StatusCode)

for {
// Prompt for adding an assertion
p := promptui.Prompt{
Label: "Assertion",
AllowEdit: true,
Expand All @@ -184,7 +187,8 @@ func addAssertions(spec *test.Spec, runres *test.RunResult) error {
}

if res.Failure != nil {
return fmt.Errorf(res.Failure.Message)
// Safely format the error message
return fmt.Errorf("%s", res.Failure.Message)
}

return nil
Expand All @@ -196,6 +200,7 @@ func addAssertions(spec *test.Spec, runres *test.RunResult) error {
}
spec.Assertions = append(spec.Assertions, a)

// Prompt to ask if another assertion should be added
p = promptui.Prompt{
Label: "Add another assertion?",
IsConfirm: true,
Expand All @@ -205,6 +210,7 @@ func addAssertions(spec *test.Spec, runres *test.RunResult) error {
if err != nil && err != promptui.ErrAbort {
return err
}
// Break if the user chooses not to continue
if strings.TrimSpace(cont) != "" && strings.ToLower(cont) != "y" {
break
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/util/test-run.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -29,8 +29,8 @@ import (
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"

"github.com/gitpod-io/dazzle/pkg/fancylog"
"github.com/gitpod-io/dazzle/pkg/test"
"github.com/khulnasoft/dazzle/pkg/fancylog"
"github.com/khulnasoft/dazzle/pkg/test"
)

var testRunCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/util/test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion cmd/util/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/gitpod-io/dazzle
module github.com/khulnasoft/dazzle

go 1.19

Expand Down
2 changes: 1 addition & 1 deletion integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Run the integration tests
# NOTE: the TARGET_REF is hostname:port
# shellcheck disable=SC2034
BUILDKIT_ADDR=unix:///run/buildkit/buildkitd.sock TARGET_REF=127.0.0.1:5000 go test -count 1 -run ^Test.*_integration$ github.com/gitpod-io/dazzle/pkg/dazzle -v
BUILDKIT_ADDR=unix:///run/buildkit/buildkitd.sock TARGET_REF=127.0.0.1:5000 go test -count 1 -run ^Test.*_integration$ github.com/khulnasoft/dazzle/pkg/dazzle -v
4 changes: 2 additions & 2 deletions main-util.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,7 +23,7 @@

package main

import cmd "github.com/gitpod-io/dazzle/cmd/util"
import cmd "github.com/khulnasoft/dazzle/cmd/util"

func main() {
cmd.Execute()
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 Gitpod
// Copyright © 2020 Khulnasoft

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,7 +23,7 @@

package main

import cmd "github.com/gitpod-io/dazzle/cmd/core"
import cmd "github.com/khulnasoft/dazzle/cmd/core"

func main() {
cmd.Execute()
Expand Down
Loading

0 comments on commit 41458de

Please sign in to comment.