Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiankrome0001 committed Dec 13, 2024
2 parents d84081d + 196f232 commit 7f57b6e
Show file tree
Hide file tree
Showing 414 changed files with 8,496 additions and 7,838 deletions.
2 changes: 0 additions & 2 deletions .changes/.next
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@
# This file can also be left empty - if it is, then the next version is
# automagically determined from release note entries (and then adding to the
# patch release).

v0.15.0
6 changes: 0 additions & 6 deletions .changes/unreleased/Added-20241026-123323.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .changes/unreleased/Added-20241114-115027.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .changes/unreleased/Added-20241114-123823.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions .changes/unreleased/Added-20241120-140601.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions .changes/unreleased/Added-20241126-203335.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .changes/unreleased/Fixed-20241112-151649.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions .changes/unreleased/Fixed-20241113-221407.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions .changes/unreleased/Fixed-20241120-160241.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .changes/unreleased/Fixed-20241121-155915.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions .changes/unreleased/Fixed-20241121-211357.yaml

This file was deleted.

40 changes: 40 additions & 0 deletions .changes/v0.15.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## v0.15.0 - 2024-12-11

### 🔥 Breaking Changes
- `Container.asService` now uses the command specified by `withDefaultArgs` instead of the last `withExec` command by @rajatjindal in https://github.com/dagger/dagger/pull/8865 \
Users can override the args by providing the `args` option to `asService`.
They can also configure the container to use the container entrypoint by using
`useEntrypoint` option.

### Added
- Better TUI errors, new cached/pending states, duration accounting and fewer spans by @vito in https://github.com/dagger/dagger/pull/8442
- Custom dagger `engine.json` config file by @jedevc in https://github.com/dagger/dagger/pull/8800 \
This new config file format is intended to eventually replace the old
buildkit-style `engine.toml` file that's currently used for configuration.

This file can be either mounted directly into a manually started engine at
`/etc/dagger/engine.toml`, or it will automatically mounted from the
user's `~/.config/dagger/engine.json` when the engine is started.
- Filesync performance is improved by @sipsma in https://github.com/dagger/dagger/pull/8818 \
The engine now re-uses previously loaded data more reliably and in more
cases, which speeds up repeated reloads of the same or similar (i.e.
overlapping data).

Uncached filesyncs of large amounts of data is also faster and uses less
memory in the engine.
- Added `dagger uninstall` command to remove a dependency by @rajatjindal in https://github.com/dagger/dagger/pull/8745
- Added memory and network telemetry for execs by @cwlbraa in https://github.com/dagger/dagger/pull/8880 https://github.com/dagger/dagger/pull/8902
- Added `DAGGER_LEAVE_OLD_ENGINE` environment variable to optionally prevent removal of old engine containers during upgrades by [devin](https://github.com/apps/devin-ai-integration) in https://github.com/dagger/dagger/pull/8195

### Fixed
- `Directory.terminal` API works now by @sipsma in https://github.com/dagger/dagger/pull/8952
- Fix resource leaks in the engine that occurred after each debug terminal was opened by @sipsma in https://github.com/dagger/dagger/pull/9013
- Fix cache mounts not being included in interactive debug containers by @sipsma in https://github.com/dagger/dagger/pull/9034
- Allow `Container.withExec` `expect` to catch exit code 128 by @jedevc in https://github.com/dagger/dagger/pull/9027
- Correctly apply ignore pattern when pulling a directory from git by @TomChv in https://github.com/dagger/dagger/pull/8931
- Fix panic on null `Directory.digest` by @jedevc in https://github.com/dagger/dagger/pull/8946

### What to do next?
- Read the [documentation](https://docs.dagger.io)
- Join our [Discord server](https://discord.gg/dagger-io)
- Follow us on [Twitter](https://twitter.com/dagger_io)
9 changes: 9 additions & 0 deletions .changes/v0.15.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## v0.15.1 - 2024-12-12

### Fixed
- Metrics display in the TUI is fixed to display for all executed containers, rather than just services by @sipsma in https://github.com/dagger/dagger/pull/9171

### What to do next?
- Read the [documentation](https://docs.dagger.io)
- Join our [Discord server](https://discord.gg/dagger-io)
- Follow us on [Twitter](https://twitter.com/dagger_io)
11 changes: 5 additions & 6 deletions .dagger/build/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,20 @@ func (build *Builder) pythonSDKContent(ctx context.Context) (*sdkContent, error)
func (build *Builder) typescriptSDKContent(ctx context.Context) (*sdkContent, error) {
rootfs := dag.Directory().WithDirectory("/", build.source.Directory("sdk/typescript"), dagger.DirectoryWithDirectoryOpts{
Include: []string{
"**/*.ts",
"src/**/*.ts",
"LICENSE",
"README.md",
"runtime",
"package.json",
"dagger.json",
},
Exclude: []string{
"node_modules",
"dist",
"**/test",
"**/*.spec.ts",
"dev",
"src/**/test/*",
"src/**/*.spec.ts",
"src/provisioning",
},
})

sdkCtrTarball := dag.Container().
WithRootfs(rootfs).
WithFile("/codegen", build.CodegenBinary()).
Expand Down
74 changes: 63 additions & 11 deletions .dagger/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package main
import (
"context"
"fmt"
"net/url"
"strings"

"golang.org/x/mod/semver"
"golang.org/x/sync/errgroup"

"github.com/dagger/dagger/.dagger/build"
Expand All @@ -25,7 +27,8 @@ func (cli *CLI) Binary(

const (
// https://github.com/goreleaser/goreleaser/releases
goReleaserVersion = "v2.3.2"
goReleaserVersion = "v2.4.8"
goReleaserImage = "ghcr.io/goreleaser/goreleaser-pro:" + goReleaserVersion + "-pro"
)

// Publish the CLI using GoReleaser
Expand All @@ -42,7 +45,6 @@ func (cli *CLI) Publish(

awsRegion string,
awsBucket string,
awsCloudfrontDistribution string,
artefactsFQDN string,
) error {
ctr, err := publishEnv(ctx)
Expand Down Expand Up @@ -87,7 +89,6 @@ func (cli *CLI) Publish(
WithSecretVariable("AWS_SECRET_ACCESS_KEY", awsSecretAccessKey).
WithEnvVariable("AWS_REGION", awsRegion).
WithEnvVariable("AWS_BUCKET", awsBucket).
WithEnvVariable("AWS_CLOUDFRONT_DISTRIBUTION_ID", awsCloudfrontDistribution).
WithEnvVariable("ARTEFACTS_FQDN", artefactsFQDN).
WithEnvVariable("ENGINE_VERSION", cli.Dagger.Version).
WithEnvVariable("ENGINE_TAG", cli.Dagger.Tag).
Expand All @@ -99,6 +100,57 @@ func (cli *CLI) Publish(
return err
}

func (cli *CLI) PublishMetadata(
ctx context.Context,

awsAccessKeyID *dagger.Secret,
awsSecretAccessKey *dagger.Secret,
awsRegion string,
awsBucket string,
awsCloudfrontDistribution string,
) error {
ctr := dag.
Alpine(dagger.AlpineOpts{
Packages: []string{"aws-cli"},
}).
Container().
WithWorkdir("/src").
WithDirectory(".", cli.Dagger.Source()).
WithSecretVariable("AWS_ACCESS_KEY_ID", awsAccessKeyID).
WithSecretVariable("AWS_SECRET_ACCESS_KEY", awsSecretAccessKey).
WithEnvVariable("AWS_REGION", awsRegion).
WithEnvVariable("AWS_EC2_METADATA_DISABLED", "true")

// update install scripts
ctr = ctr.
WithExec([]string{"aws", "s3", "cp", "./install.sh", s3Path(awsBucket, "dagger/install.sh")}).
WithExec([]string{"aws", "s3", "cp", "./install.ps1", s3Path(awsBucket, "dagger/install.ps1")}).
WithExec([]string{"aws", "cloudfront", "create-invalidation", "--distribution-id", awsCloudfrontDistribution, "--paths", "/dagger/install.sh", "/dagger/install.ps1"})

// update version pointers (only on proper releases)
if version := cli.Dagger.Version; semver.IsValid(version) && semver.Prerelease(version) == "" {
cpOpts := dagger.ContainerWithExecOpts{
Stdin: strings.TrimPrefix(version, "v"),
}
ctr = ctr.
WithExec([]string{"aws", "s3", "cp", "-", s3Path(awsBucket, "dagger/latest_version")}, cpOpts).
WithExec([]string{"aws", "s3", "cp", "-", s3Path(awsBucket, "dagger/versions/latest")}, cpOpts).
WithExec([]string{"aws", "s3", "cp", "-", s3Path(awsBucket, "dagger/versions/%s", strings.TrimPrefix(semver.MajorMinor(version), "v"))}, cpOpts)
}

_, err := ctr.Sync(ctx)
return err
}

func s3Path(bucket string, path string, args ...any) string {
u := url.URL{
Scheme: "s3",
Host: bucket,
Path: fmt.Sprintf(path, args...),
}
return u.String()
}

// Verify that the CLI builds without actually publishing anything
func (cli *CLI) TestPublish(ctx context.Context) error {
// TODO: ideally this would also use go releaser, but we want to run this
Expand Down Expand Up @@ -151,14 +203,14 @@ func (cli *CLI) TestPublish(ctx context.Context) error {
}

func publishEnv(ctx context.Context) (*dagger.Container, error) {
// TODO: remove after upgrading to GoReleaser Pro has go 1.23.2 (it currently only has go 1.23.1)
go1_23_2 := dag.Container().From("golang:1.23.2-alpine@sha256:9dd2625a1ff2859b8d8b01d8f7822c0f528942fe56cfe7a1e7c38d3b8d72d679").Directory("/usr/local/go")

ctr := dag.Container().
From(fmt.Sprintf("ghcr.io/goreleaser/goreleaser-pro:%s-pro", goReleaserVersion)).
WithDirectory("/usr/local/go", go1_23_2).
WithEntrypoint([]string{}).
WithExec([]string{"apk", "add", "aws-cli"})
ctr := dag.Container().From(goReleaserImage)

// HACK: this can be enabled to force a go update (e.g. when we need it for
// a security update)
// ctr = ctr.WithDirectory(
// "/usr/local/go",
// dag.Container().From("golang:<version>-alpine@sha256:<hash>").Directory("/usr/local/go"),
// )

// install nix
ctr = ctr.
Expand Down
Loading

0 comments on commit 7f57b6e

Please sign in to comment.