status
stringclasses 1
value | repo_name
stringclasses 31
values | repo_url
stringclasses 31
values | issue_id
int64 1
104k
| title
stringlengths 4
233
| body
stringlengths 0
186k
β | issue_url
stringlengths 38
56
| pull_url
stringlengths 37
54
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
timestamp[us, tz=UTC] | language
stringclasses 5
values | commit_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | Description string
Id string
Name string
}
convert := func(fields []subcommands) []ProjectCommand {
out := []ProjectCommand{}
for i := range fields {
out = append(out, ProjectCommand{description: &fields[i].Description, id: &fields[i].Id, name: &fields[i].Name})
}
return out
}
var response []subcommands
q = q.Bind(&response)
err := q.Execute(ctx, r.c)
if err != nil {
return nil, err
}
return convert(response), nil
}
type ProjectCommandFlag struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | q *querybuilder.Selection
c graphql.Client
description *string
name *string
}
func (r *ProjectCommandFlag) Description(ctx context.Context) (string, error) {
if r.description != nil {
return *r.description, nil
}
q := r.q.Select("description")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *ProjectCommandFlag) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.q.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *Client) CacheVolume(key string) *CacheVolume {
q := r.q.Select("cacheVolume")
q = q.Arg("key", key)
return &CacheVolume{
q: q, |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | c: r.c,
}
}
type ContainerOpts struct {
ID ContainerID
Platform Platform
}
func (r *Client) Container(opts ...ContainerOpts) *Container {
q := r.q.Select("container")
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].ID) {
q = q.Arg("id", opts[i].ID)
break
}
}
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].Platform) {
q = q.Arg("platform", opts[i].Platform)
break
}
}
return &Container{
q: q,
c: r.c,
}
}
func (r *Client) DefaultPlatform(ctx context.Context) (Platform, error) {
q := r.q.Select("defaultPlatform") |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | var response Platform
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
type DirectoryOpts struct {
ID DirectoryID
}
func (r *Client) Directory(opts ...DirectoryOpts) *Directory {
q := r.q.Select("directory")
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].ID) {
q = q.Arg("id", opts[i].ID)
break
}
}
return &Directory{
q: q,
c: r.c,
}
}
func (r *Client) File(id FileID) *File {
q := r.q.Select("file")
q = q.Arg("id", id)
return &File{
q: q,
c: r.c,
}
}
type GitOpts struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | KeepGitDir bool
ExperimentalServiceHost *Container
}
func (r *Client) Git(url string, opts ...GitOpts) *GitRepository {
q := r.q.Select("git")
q = q.Arg("url", url)
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].KeepGitDir) {
q = q.Arg("keepGitDir", opts[i].KeepGitDir)
break
}
}
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].ExperimentalServiceHost) {
q = q.Arg("experimentalServiceHost", opts[i].ExperimentalServiceHost)
break
}
}
return &GitRepository{
q: q, |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | c: r.c,
}
}
func (r *Client) Host() *Host {
q := r.q.Select("host")
return &Host{
q: q,
c: r.c,
}
}
type HTTPOpts struct {
ExperimentalServiceHost *Container
}
func (r *Client) HTTP(url string, opts ...HTTPOpts) *File {
q := r.q.Select("http")
q = q.Arg("url", url)
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].ExperimentalServiceHost) {
q = q.Arg("experimentalServiceHost", opts[i].ExperimentalServiceHost)
break
}
}
return &File{
q: q,
c: r.c,
}
}
type PipelineOpts struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | Description string
Labels []PipelineLabel
}
func (r *Client) Pipeline(name string, opts ...PipelineOpts) *Client {
q := r.q.Select("pipeline")
q = q.Arg("name", name)
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].Description) {
q = q.Arg("description", opts[i].Description)
break
}
}
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].Labels) {
q = q.Arg("labels", opts[i].Labels)
break
}
}
return &Client{
q: q,
c: r.c,
}
}
type ProjectOpts struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | ID ProjectID
}
func (r *Client) Project(opts ...ProjectOpts) *Project {
q := r.q.Select("project")
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].ID) {
q = q.Arg("id", opts[i].ID)
break
}
}
return &Project{
q: q,
c: r.c,
}
}
type ProjectCommandOpts struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | ID ProjectCommandID
}
func (r *Client) ProjectCommand(opts ...ProjectCommandOpts) *ProjectCommand {
q := r.q.Select("projectCommand")
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].ID) {
q = q.Arg("id", opts[i].ID)
break
}
}
return &ProjectCommand{
q: q,
c: r.c,
}
}
func (r *Client) Secret(id SecretID) *Secret {
q := r.q.Select("secret")
q = q.Arg("id", id)
return &Secret{
q: q, |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | c: r.c,
}
}
func (r *Client) SetSecret(name string, plaintext string) *Secret {
q := r.q.Select("setSecret")
q = q.Arg("name", name)
q = q.Arg("plaintext", plaintext)
return &Secret{
q: q,
c: r.c,
}
}
type SocketOpts struct {
ID SocketID
}
func (r *Client) Socket(opts ...SocketOpts) *Socket {
q := r.q.Select("socket")
for i := len(opts) - 1; i >= 0; i-- {
if !querybuilder.IsZeroValue(opts[i].ID) {
q = q.Arg("id", opts[i].ID)
break
}
}
return &Socket{
q: q,
c: r.c,
}
}
type Secret struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | q *querybuilder.Selection
c graphql.Client
id *SecretID
plaintext *string
}
func (r *Secret) ID(ctx context.Context) (SecretID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response SecretID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
func (r *Secret) XXX_GraphQLType() string {
return "Secret" |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | }
func (r *Secret) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Secret) Plaintext(ctx context.Context) (string, error) {
if r.plaintext != nil {
return *r.plaintext, nil
}
q := r.q.Select("plaintext")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx, r.c)
}
type Socket struct {
q *querybuilder.Selection
c graphql.Client
id *SocketID
}
func (r *Socket) ID(ctx context.Context) (SocketID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.q.Select("id")
var response SocketID
q = q.Bind(&response)
return response, q.Execute(ctx, r.c) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,140 | Expand environment variables in `withEnvVariable` values | ### Discussed in https://github.com/dagger/dagger/discussions/5001
<div type='discussions-op-text'>
<sup>Originally posted by **wingyplus** April 21, 2023</sup>
I want to install something and append it to `PATH` to make it accessible. So how to prepend the new directory into the env variable as we do with `PATH`?</div>
Solution proposed by @vito :
> I agree; extending $PATH seems like a common use case. it would be nice to have parity with Dockerfile ENV which supports interpolation.
>
> It might be a surprising default, since who knows what values people might try to set in env vars. An expand: true param would be simple enough to implement by using [os.Expand](https://pkg.go.dev/os#Expand) and fetching values from the current image config.
>
> ```
> container {
> withEnvVariable(name: "PATH", value: "/opt/venv/bin:${PATH}", expand: true) {
> withExec(args: []string{"sh", "-c", "echo $PATH"}) {
> stdout
> }
> }
> }
> ```
> (Interpolate might be a more obvious name.) | https://github.com/dagger/dagger/issues/5140 | https://github.com/dagger/dagger/pull/5160 | c2fcf8390801585188042d12ee8190b436cc9c2f | e171dc4252e464031737b51fee4c54531b4b537d | 2023-05-16T15:18:49Z | go | 2023-05-25T09:29:47Z | sdk/go/api.gen.go | }
func (r *Socket) XXX_GraphQLType() string {
return "Socket"
}
func (r *Socket) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
type CacheSharingMode string
const (
Locked CacheSharingMode = "LOCKED"
Private CacheSharingMode = "PRIVATE"
Shared CacheSharingMode = "SHARED"
)
type ImageLayerCompression string
const (
Estargz ImageLayerCompression = "EStarGZ"
Gzip ImageLayerCompression = "Gzip"
Uncompressed ImageLayerCompression = "Uncompressed"
Zstd ImageLayerCompression = "Zstd"
)
type NetworkProtocol string
const (
Tcp NetworkProtocol = "TCP"
Udp NetworkProtocol = "UDP"
) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | core/schema/secret.go | package schema
import (
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/router"
)
type secretSchema struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | core/schema/secret.go | *baseSchema
}
var _ router.ExecutableSchema = &secretSchema{}
func (s *secretSchema) Name() string {
return "secret"
}
func (s *secretSchema) Schema() string {
return Secret
}
var secretIDResolver = stringResolver(core.SecretID(""))
func (s *secretSchema) Resolvers() router.Resolvers {
return router.Resolvers{
"SecretID": secretIDResolver,
"Query": router.ObjectResolver{
"secret": router.ToResolver(s.secret),
"setSecret": router.ToResolver(s.setSecret),
},
"Secret": router.ObjectResolver{
"id": router.ToResolver(s.id),
"plaintext": router.ToResolver(s.plaintext),
},
}
}
func (s *secretSchema) Dependencies() []router.ExecutableSchema {
return nil
}
func (s *secretSchema) id(ctx *router.Context, parent *core.Secret, args any) (core.SecretID, error) {
return parent.ID()
}
type secretArgs struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | core/schema/secret.go | ID core.SecretID
}
func (s *secretSchema) secret(ctx *router.Context, parent any, args secretArgs) (*core.Secret, error) {
return args.ID.ToSecret()
}
type setSecretArgs struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | core/schema/secret.go | Name string
Plaintext string
}
func (s *secretSchema) setSecret(ctx *router.Context, parent any, args setSecretArgs) (*core.Secret, error) {
secretID, err := s.secrets.AddSecret(ctx, args.Name, args.Plaintext)
if err != nil {
return nil, err
}
return secretID.ToSecret()
}
func (s *secretSchema) plaintext(ctx *router.Context, parent *core.Secret, args any) (string, error) {
if parent.IsOldFormat() {
bytes, err := parent.LegacyPlaintext(ctx, s.gw)
return string(bytes), err
}
id, err := parent.ID()
if err != nil {
return "", err
}
bytes, err := s.secrets.GetSecret(ctx, id.String())
if err != nil {
return "", err
}
return string(bytes), nil
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | router/schema.go | package router
import (
"context"
"encoding/json"
"fmt"
"strings"
"github.com/dagger/dagger/core/pipeline"
"github.com/dagger/graphql"
"github.com/opencontainers/go-digest"
"github.com/vito/progrock"
)
type LoadedSchema interface {
Name() string
Schema() string
}
type ExecutableSchema interface {
LoadedSchema
Resolvers() Resolvers
Dependencies() []ExecutableSchema
}
type Resolvers map[string]Resolver
type Resolver interface {
_resolver()
}
type ObjectResolver map[string]graphql.FieldResolveFn
func (ObjectResolver) _resolver() {}
type ScalarResolver struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | router/schema.go | Serialize graphql.SerializeFn
ParseValue graphql.ParseValueFn
ParseLiteral graphql.ParseLiteralFn
}
func (ScalarResolver) _resolver() {}
type StaticSchemaParams struct {
Name string
Schema string
Resolvers Resolvers
Dependencies []ExecutableSchema
}
func StaticSchema(p StaticSchemaParams) ExecutableSchema {
return &staticSchema{p}
}
var _ ExecutableSchema = &staticSchema{}
type staticSchema struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | router/schema.go | StaticSchemaParams
}
func (s *staticSchema) Name() string {
return s.StaticSchemaParams.Name
}
func (s *staticSchema) Schema() string {
return s.StaticSchemaParams.Schema
}
func (s *staticSchema) Resolvers() Resolvers {
return s.StaticSchemaParams.Resolvers
}
func (s *staticSchema) Dependencies() []ExecutableSchema {
return s.StaticSchemaParams.Dependencies
}
type Context struct {
context.Context
ResolveParams graphql.ResolveParams
Vertex *progrock.VertexRecorder
}
type Pipelineable interface {
PipelinePath() pipeline.Path
}
type Digestible interface {
Digest() (digest.Digest, error)
}
func ToResolver[P any, A any, R any](f func(*Context, P, A) (R, error)) graphql.FieldResolveFn { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | router/schema.go | return func(p graphql.ResolveParams) (any, error) {
recorder := progrock.RecorderFromContext(p.Context)
var args A
argBytes, err := json.Marshal(p.Args)
if err != nil {
return nil, fmt.Errorf("failed to marshal args: %w", err)
}
if err := json.Unmarshal(argBytes, &args); err != nil {
return nil, fmt.Errorf("failed to unmarshal args: %w", err)
}
parent, ok := p.Source.(P)
if !ok {
parentBytes, err := json.Marshal(p.Source)
if err != nil {
return nil, fmt.Errorf("failed to marshal parent: %w", err)
}
if err := json.Unmarshal(parentBytes, &parent); err != nil {
return nil, fmt.Errorf("failed to unmarshal parent: %w", err)
}
}
if pipelineable, ok := p.Source.(Pipelineable); ok {
recorder = pipelineable.PipelinePath().RecorderGroup(recorder)
p.Context = progrock.RecorderToContext(p.Context, recorder) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | router/schema.go | }
vtx, err := queryVertex(recorder, p)
if err != nil {
return nil, err
}
ctx := Context{
Context: p.Context,
ResolveParams: p,
Vertex: vtx,
}
res, err := f(&ctx, parent, args)
if err != nil {
vtx.Done(err)
return nil, err
}
if edible, ok := any(res).(Digestible); ok {
dg, err := edible.Digest()
if err != nil {
return nil, fmt.Errorf("failed to compute digest: %w", err)
}
vtx.Output(dg)
}
vtx.Done(nil)
return res, nil
}
}
func PassthroughResolver(p graphql.ResolveParams) (any, error) {
return ToResolver(func(ctx *Context, parent any, args any) (any, error) {
if parent == nil {
parent = struct{}{} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | router/schema.go | }
return parent, nil
})(p)
}
func ErrResolver(err error) graphql.FieldResolveFn {
return ToResolver(func(ctx *Context, parent any, args any) (any, error) {
return nil, err
})
}
func queryVertex(recorder *progrock.Recorder, params graphql.ResolveParams) (*progrock.VertexRecorder, error) {
dig, err := queryDigest(params)
if err != nil {
return nil, fmt.Errorf("failed to compute query digest: %w", err)
}
var inputs []digest.Digest
name := params.Info.FieldName
if len(params.Args) > 0 {
name += "("
args := []string{}
for name, val := range params.Args {
if dg, ok := val.(Digestible); ok {
d, err := dg.Digest()
if err != nil {
return nil, fmt.Errorf("failed to compute digest for param %q: %w", name, err) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | router/schema.go | }
inputs = append(inputs, d)
val = d
}
jv, err := json.Marshal(val)
if err != nil {
return nil, fmt.Errorf("failed to marshal arg %s: %w", name, err)
}
args = append(args, fmt.Sprintf("%s: %s", name, jv))
}
name += strings.Join(args, ", ")
name += ")"
}
if edible, ok := params.Source.(Digestible); ok {
id, err := edible.Digest()
if err != nil {
return nil, fmt.Errorf("failed to compute digest: %w", err)
}
inputs = append(inputs, id)
}
return recorder.Vertex(
dig,
name,
progrock.WithInputs(inputs...),
progrock.Internal(),
), nil
}
func queryDigest(params graphql.ResolveParams) (digest.Digest, error) {
type subset struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,171 | π Running TUI with `--debug` flag exposes secret values | ### What is the issue?
Running the TUI with `dagger run --debug` exposes the secrets otherwise masked in the logs. I can observe the `withSecretVariable` being exposed in the listing of stages.
### Log output
_No response_
### Steps to reproduce
Run any pipeline that has a `withSecretVar` with `dagger run --debug go run pipeline.go`
### SDK version
Go SDK 0.6.3
### OS version
Mac OS 12.6.2 | https://github.com/dagger/dagger/issues/5171 | https://github.com/dagger/dagger/pull/5186 | e171dc4252e464031737b51fee4c54531b4b537d | 6f171dca6d2456ad5602dba4e1348b1762bd2ec8 | 2023-05-23T04:41:10Z | go | 2023-05-25T14:21:41Z | router/schema.go | Source any
Field string
Args map[string]any
}
payload, err := json.Marshal(subset{
Source: params.Source,
Field: params.Info.FieldName,
Args: params.Args,
})
if err != nil {
return "", err
}
return digest.SHA256.FromBytes(payload), nil
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/engine.go | package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"os"
tea "github.com/charmbracelet/bubbletea"
"github.com/dagger/dagger/engine"
internalengine "github.com/dagger/dagger/internal/engine"
"github.com/dagger/dagger/internal/tui"
"github.com/dagger/dagger/router"
"github.com/mattn/go-isatty"
"github.com/vito/progrock"
)
var useTUI = isatty.IsTerminal(os.Stdout.Fd()) ||
isatty.IsTerminal(os.Stderr.Fd())
var interactive = os.Getenv("_EXPERIMENTAL_DAGGER_INTERACTIVE_TUI") != ""
func withEngineAndTUI( |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/engine.go | ctx context.Context,
engineConf engine.Config,
fn engine.StartCallback,
) error {
if engineConf.Workdir == "" {
engineConf.Workdir = workdir
}
if engineConf.RunnerHost == "" {
engineConf.RunnerHost = internalengine.RunnerHost()
}
engineConf.DisableHostRW = disableHostRW
if engineConf.JournalFile == "" {
engineConf.JournalFile = os.Getenv("_EXPERIMENTAL_DAGGER_JOURNAL")
}
if !useTUI {
if engineConf.LogOutput == nil {
engineConf.LogOutput = os.Stderr
}
return engine.Start(ctx, engineConf, fn)
}
if interactive {
return interactiveTUI(ctx, engineConf, fn)
}
return inlineTUI(ctx, engineConf, fn)
}
func progrockTee(progW progrock.Writer) (progrock.Writer, error) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/engine.go | if log := os.Getenv("_EXPERIMENTAL_DAGGER_PROGROCK_JOURNAL"); log != "" {
fileW, err := newProgrockWriter(log)
if err != nil {
return nil, fmt.Errorf("open progrock log: %w", err)
}
return progrock.MultiWriter{progW, fileW}, nil
}
return progW, nil
}
func interactiveTUI( |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/engine.go | ctx context.Context,
engineConf engine.Config,
fn engine.StartCallback,
) error {
progR, progW := progrock.Pipe()
progW, err := progrockTee(progW)
if err != nil {
return err
}
engineConf.ProgrockWriter = progW
ctx, quit := context.WithCancel(ctx)
defer quit()
program := tea.NewProgram(tui.New(quit, progR), tea.WithAltScreen())
tuiDone := make(chan error, 1)
go func() {
_, err := program.Run()
tuiDone <- err
}()
var cbErr error
engineErr := engine.Start(ctx, engineConf, func(ctx context.Context, api *router.Router) error {
cbErr = fn(ctx, api)
return cbErr
})
if cbErr != nil {
return cbErr
}
tuiErr := <-tuiDone
return errors.Join(tuiErr, engineErr) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/engine.go | }
func inlineTUI(
ctx context.Context,
engineConf engine.Config,
fn engine.StartCallback,
) error {
tape := progrock.NewTape()
if debugLogs {
tape.ShowInternal(true)
}
progW, engineErr := progrockTee(tape)
if engineErr != nil {
return engineErr
}
engineConf.ProgrockWriter = progW
ctx, quit := context.WithCancel(ctx)
defer quit()
stop := progrock.DefaultUI().RenderLoop(quit, tape, os.Stderr, true)
defer stop()
var cbErr error
engineErr = engine.Start(ctx, engineConf, func(ctx context.Context, api *router.Router) error {
cbErr = fn(ctx, api)
return cbErr
})
if cbErr != nil {
return cbErr
}
return engineErr
}
func newProgrockWriter(dest string) (progrock.Writer, error) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/engine.go | f, err := os.Create(dest)
if err != nil {
return nil, err
}
return progrockFileWriter{
enc: json.NewEncoder(f),
c: f,
}, nil
}
type progrockFileWriter struct {
enc *json.Encoder
c io.Closer
}
var _ progrock.Writer = progrockFileWriter{}
func (p progrockFileWriter) WriteStatus(update *progrock.StatusUpdate) error {
return p.enc.Encode(update)
}
func (p progrockFileWriter) Close() error {
return p.c.Close()
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/run.go | package main
import (
"context"
"errors"
"fmt"
"net"
"net/http"
"os"
"os/exec"
"strings"
"time"
"github.com/dagger/dagger/engine"
"github.com/dagger/dagger/router"
"github.com/google/uuid"
"github.com/spf13/cobra"
"github.com/vito/progrock"
)
var runCmd = &cobra.Command{
Use: "run [command]",
Aliases: []string{"r"},
DisableFlagsInUseLine: true,
Long: `Runs the specified command in a Dagger session and shows progress in a TUI
DAGGER_SESSION_PORT and DAGGER_SESSION_TOKEN will be convieniently injected automatically.`, |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/run.go | Short: "Runs a command in a Dagger session",
Example: ` Run a Dagger pipeline written in Go:
dagger run go run main.go
Run a Dagger pipeline written in Node.js:
dagger run node index.mjs
Run a Dagger pipeline written in Python:
dagger run python main.py
Run a Dagger API request directly:
jq -n '{query:"{container{id}}"}' | \
dagger run sh -c 'curl -s \
-u $DAGGER_SESSION_TOKEN: \
-H "content-type:application/json" \
-d @- \
http://127.0.0.1:$DAGGER_SESSION_PORT/query'`,
Run: Run,
Args: cobra.MinimumNArgs(1),
SilenceUsage: true,
}
var waitDelay time.Duration
func init() {
runCmd.Flags().SetInterspersed(false)
runCmd.Flags().DurationVar(
&waitDelay,
"cleanup-timeout",
10*time.Second,
"max duration to wait between SIGTERM and SIGKILL on interrupt",
)
}
func Run(cmd *cobra.Command, args []string) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/run.go | ctx := context.Background()
err := run(ctx, args)
if err != nil {
if errors.Is(err, context.Canceled) {
fmt.Fprintln(os.Stderr, "run canceled")
os.Exit(2)
return
}
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
return
}
}
func run(ctx context.Context, args []string) error {
u, err := uuid.NewRandom()
if err != nil {
return fmt.Errorf("generate uuid: %w", err)
}
sessionToken := u.String()
return withEngineAndTUI(ctx, engine.Config{
SessionToken: sessionToken,
}, func(ctx context.Context, api *router.Router) error {
sessionL, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
return fmt.Errorf("session listen: %w", err)
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | cmd/dagger/run.go | defer sessionL.Close()
sessionPort := fmt.Sprintf("%d", sessionL.Addr().(*net.TCPAddr).Port)
os.Setenv("DAGGER_SESSION_PORT", sessionPort)
os.Setenv("DAGGER_SESSION_TOKEN", sessionToken)
subCmd := exec.CommandContext(ctx, args[0], args[1:]...)
subCmd.Stdin = os.Stdin
ensureChildProcessesAreKilled(subCmd)
go http.Serve(sessionL, api)
var cmdErr error
if useTUI {
rec := progrock.RecorderFromContext(ctx)
cmdline := strings.Join(subCmd.Args, " ")
cmdVtx := rec.Vertex("cmd", cmdline)
subCmd.Stdout = cmdVtx.Stdout()
subCmd.Stderr = cmdVtx.Stderr()
cmdErr = subCmd.Run()
cmdVtx.Done(cmdErr)
} else {
subCmd.Stdout = os.Stdout
subCmd.Stderr = os.Stderr
cmdErr = subCmd.Run()
}
return cmdErr
})
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | core/pipeline/pipeline.go | package pipeline
import (
"encoding/json"
"strings"
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/solver/pb"
"github.com/vito/progrock"
)
type Pipeline struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | core/pipeline/pipeline.go | Name string `json:"name"`
Description string `json:"description,omitempty"`
Labels []Label `json:"labels,omitempty"`
}
type Path []Pipeline
func (g Path) Copy() Path {
copy := make(Path, 0, len(g))
copy = append(copy, g...)
return copy
}
func (g Path) Add(pipeline Pipeline) Path {
newPath := g.Copy()
newPath = append(newPath, pipeline)
return newPath
}
func (g Path) ID() string {
id, err := json.Marshal(g)
if err != nil {
panic(err)
}
return string(id) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | core/pipeline/pipeline.go | }
func (g Path) Name() string {
if len(g) == 0 {
return ""
}
return g[len(g)-1].Name
}
func (g Path) String() string {
parts := []string{}
for _, part := range g {
parts = append(parts, part.Name)
}
return strings.Join(parts, " / ")
}
func (g Path) RecorderGroup(rec *progrock.Recorder) *progrock.Recorder {
if len(g) == 0 {
return rec
}
g = g[1:]
for _, p := range g {
var labels []*progrock.Label
for _, l := range p.Labels {
labels = append(labels, &progrock.Label{
Name: l.Name,
Value: l.Value,
})
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | core/pipeline/pipeline.go | rec = rec.WithGroup(p.Name, labels...)
}
return rec
}
func (g Path) ProgressGroup() *pb.ProgressGroup {
return &pb.ProgressGroup{
Id: g.ID(),
Name: g.Name(),
}
}
func (g Path) LLBOpt() llb.ConstraintsOpt {
pg := g.ProgressGroup()
return llb.ProgressGroup(pg.Id, pg.Name, pg.Weak)
}
type CustomName struct {
Name string `json:"name,omitempty"`
Pipeline Path `json:"pipeline,omitempty"`
Internal bool `json:"internal,omitempty"`
}
func (c CustomName) String() string {
enc, err := json.Marshal(c)
if err != nil {
return ""
}
return string(enc)
}
func (c CustomName) LLBOpt() llb.ConstraintsOpt {
return llb.WithCustomName(c.String())
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | package engine
import (
"context"
"encoding/json"
"fmt"
"io"
"net"
"net/url"
"os"
"path/filepath"
"strings"
"time"
"github.com/adrg/xdg"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/content/local"
"github.com/containerd/containerd/platforms"
"github.com/dagger/dagger/auth"
"github.com/dagger/dagger/core"
"github.com/dagger/dagger/core/pipeline"
"github.com/dagger/dagger/core/schema"
"github.com/dagger/dagger/internal/engine"
"github.com/dagger/dagger/internal/engine/journal"
"github.com/dagger/dagger/router"
"github.com/dagger/dagger/secret" |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | "github.com/dagger/dagger/telemetry"
"github.com/docker/cli/cli/config"
bkclient "github.com/moby/buildkit/client"
bkgw "github.com/moby/buildkit/frontend/gateway/client"
"github.com/moby/buildkit/session"
"github.com/moby/buildkit/session/filesync"
"github.com/moby/buildkit/session/secrets/secretsprovider"
"github.com/moby/buildkit/util/entitlements"
"github.com/moby/buildkit/util/progress/progressui"
specs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/tonistiigi/fsutil"
fstypes "github.com/tonistiigi/fsutil/types"
"github.com/vito/progrock"
"golang.org/x/sync/errgroup"
"google.golang.org/protobuf/types/known/timestamppb"
)
type Config struct {
Workdir string
LogOutput io.Writer
JournalFile string
JournalWriter journal.Writer
ProgrockWriter progrock.Writer
DisableHostRW bool
RunnerHost string
SessionToken string
UserAgent string
}
type StartCallback func(context.Context, *router.Router) error
func Start(ctx context.Context, startOpts Config, fn StartCallback) error { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | if startOpts.RunnerHost == "" {
return fmt.Errorf("must specify runner host")
}
if startOpts.ProgrockWriter == nil {
startOpts.ProgrockWriter = progrock.Discard{}
}
remote, err := url.Parse(startOpts.RunnerHost)
if err != nil {
return err
}
c, err := engine.NewClient(ctx, remote, startOpts.UserAgent)
if err != nil {
return err
}
if c.EngineName != "" && startOpts.LogOutput != nil {
fmt.Fprintln(startOpts.LogOutput, "Connected to engine", c.EngineName)
}
go pipeline.LoadRootLabels(startOpts.Workdir, c.EngineName)
labels := []*progrock.Label{}
for _, label := range pipeline.RootLabels() {
labels = append(labels, &progrock.Label{
Name: label.Name,
Value: label.Value,
})
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | progSock, progW, cleanup, err := progrockForwarder(startOpts.ProgrockWriter, startOpts.LogOutput)
if err != nil {
return fmt.Errorf("progress forwarding: %w", err)
}
defer cleanup()
recorder := progrock.NewRecorder(progW, labels...)
ctx = progrock.RecorderToContext(ctx, recorder)
platform, err := detectPlatform(ctx, c.BuildkitClient)
if err != nil {
return err
}
startOpts.Workdir, err = NormalizeWorkdir(startOpts.Workdir)
if err != nil {
return err
}
router := router.New(startOpts.SessionToken, recorder)
secretStore := secret.NewStore()
socketProviders := SocketProvider{
EnableHostNetworkAccess: !startOpts.DisableHostRW,
}
registryAuth := auth.NewRegistryAuthProvider(config.LoadDefaultConfigFile(os.Stderr))
var allowedEntitlements []entitlements.Entitlement
if c.PrivilegedExecEnabled {
allowedEntitlements = append(allowedEntitlements, entitlements.EntitlementSecurityInsecure)
}
ociStoreDir := filepath.Join(xdg.CacheHome, "dagger", "oci")
ociStore, err := local.NewStore(ociStoreDir) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | if err != nil {
return err
}
solveOpts := bkclient.SolveOpt{
Session: []session.Attachable{
registryAuth,
secretsprovider.NewSecretProvider(secretStore),
socketProviders,
},
AllowedEntitlements: allowedEntitlements,
OCIStores: map[string]content.Store{
core.OCIStoreName: ociStore,
},
}
cacheConfigType, cacheConfigAttrs, err := cacheConfigFromEnv()
if err != nil {
return err
}
cacheConfigEnabled := cacheConfigType != ""
if cacheConfigEnabled {
solveOpts.CacheExports = []bkclient.CacheOptionsEntry{{
Type: cacheConfigType,
Attrs: cacheConfigAttrs,
}}
solveOpts.CacheImports = []bkclient.CacheOptionsEntry{{
Type: cacheConfigType,
Attrs: cacheConfigAttrs, |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | }}
}
if !startOpts.DisableHostRW {
solveOpts.Session = append(solveOpts.Session, filesync.NewFSSyncProvider(AnyDirSource{}))
}
eg, groupCtx := errgroup.WithContext(ctx)
solveCh := make(chan *bkclient.SolveStatus)
eg.Go(func() error {
return handleSolveEvents(recorder, startOpts, solveCh)
})
eg.Go(func() error {
_, err := c.BuildkitClient.Build(groupCtx, solveOpts, "", func(ctx context.Context, gw bkgw.Client) (*bkgw.Result, error) {
secretStore.SetGateway(gw)
gwClient := core.NewGatewayClient(gw, cacheConfigType, cacheConfigAttrs)
coreAPI, err := schema.New(schema.InitializeArgs{
Router: router,
Workdir: startOpts.Workdir,
Gateway: gwClient,
BKClient: c.BuildkitClient,
SolveOpts: solveOpts,
SolveCh: solveCh,
Platform: *platform,
DisableHostRW: startOpts.DisableHostRW,
Auth: registryAuth,
EnableServices: os.Getenv(engine.ServicesDNSEnvName) != "0", |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | Secrets: secretStore,
OCIStore: ociStore,
ProgrockSocket: progSock,
})
if err != nil {
return nil, err
}
if err := router.Add(coreAPI); err != nil {
return nil, err
}
if fn == nil {
return nil, nil
}
if err := fn(ctx, router); err != nil {
return nil, err
}
if cacheConfigEnabled {
return gwClient.CombinedResult(ctx)
}
return nil, nil
}, solveCh)
return err
})
err = eg.Wait()
if err != nil { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | if ctx.Err() != nil {
return ctx.Err()
}
return err
}
return nil
}
func handleSolveEvents(recorder *progrock.Recorder, startOpts Config, upstreamCh chan *bkclient.SolveStatus) error {
eg := &errgroup.Group{}
readers := []chan *bkclient.SolveStatus{}
telemetryCh := make(chan *bkclient.SolveStatus)
readers = append(readers, telemetryCh)
eg.Go(func() error {
return uploadTelemetry(telemetryCh)
})
if startOpts.LogOutput != nil {
ch := make(chan *bkclient.SolveStatus)
readers = append(readers, ch)
cleanCh := make(chan *bkclient.SolveStatus)
eg.Go(func() error {
defer close(cleanCh)
for ev := range ch {
cleaned := *ev
cleaned.Vertexes = make([]*bkclient.Vertex, len(ev.Vertexes))
for i, v := range ev.Vertexes {
customName := pipeline.CustomName{} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | if json.Unmarshal([]byte(v.Name), &customName) == nil {
cp := *v
cp.Name = customName.Name
cleaned.Vertexes[i] = &cp
} else {
cleaned.Vertexes[i] = v
}
}
cleanCh <- &cleaned
}
return nil
})
eg.Go(func() error {
warn, err := progressui.DisplaySolveStatus(context.TODO(), nil, startOpts.LogOutput, cleanCh)
for _, w := range warn {
fmt.Fprintf(startOpts.LogOutput, "=> %s\n", w.Short)
}
return err
})
}
if startOpts.JournalFile != "" {
ch := make(chan *bkclient.SolveStatus)
readers = append(readers, ch)
eg.Go(func() error {
f, err := os.Create(startOpts.JournalFile)
if err != nil {
return err
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | defer f.Close()
enc := json.NewEncoder(f)
for ev := range ch {
entry := &journal.Entry{
Event: ev,
TS: time.Now().UTC(),
}
if err := enc.Encode(entry); err != nil {
return err
}
}
return nil
})
}
if startOpts.JournalWriter != nil {
ch := make(chan *bkclient.SolveStatus)
readers = append(readers, ch)
journalW := startOpts.JournalWriter
eg.Go(func() error {
for ev := range ch {
entry := &journal.Entry{
Event: ev,
TS: time.Now().UTC(),
}
if err := journalW.WriteEntry(entry); err != nil {
return err
}
}
return journalW.Close()
}) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | }
if startOpts.ProgrockWriter != nil {
ch := make(chan *bkclient.SolveStatus)
readers = append(readers, ch)
eg.Go(func() error {
for ev := range ch {
if err := recorder.Record(bk2progrock(ev)); err != nil {
return err
}
}
recorder.Complete()
return recorder.Close()
})
}
eventsMultiReader(upstreamCh, readers...)
return eg.Wait()
}
func eventsMultiReader(ch chan *bkclient.SolveStatus, readers ...chan *bkclient.SolveStatus) {
for ev := range ch {
for _, r := range readers {
r <- ev
}
}
for _, w := range readers {
close(w)
}
}
func uploadTelemetry(ch chan *bkclient.SolveStatus) error { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | t := telemetry.New(true)
defer t.Flush()
for ev := range ch {
ts := time.Now().UTC()
for _, v := range ev.Vertexes {
id := v.Digest.String()
var custom pipeline.CustomName
if json.Unmarshal([]byte(v.Name), &custom) != nil {
custom.Name = v.Name
if pg := v.ProgressGroup.GetId(); pg != "" {
if err := json.Unmarshal([]byte(pg), &custom.Pipeline); err != nil {
return err
}
}
}
payload := telemetry.OpPayload{
OpID: id,
OpName: custom.Name,
Internal: custom.Internal,
Pipeline: custom.Pipeline,
Started: v.Started,
Completed: v.Completed,
Cached: v.Cached,
Error: v.Error,
}
payload.Inputs = []string{}
for _, input := range v.Inputs {
payload.Inputs = append(payload.Inputs, input.String())
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | t.Push(payload, ts)
}
for _, l := range ev.Logs {
t.Push(telemetry.LogPayload{
OpID: l.Vertex.String(),
Data: string(l.Data),
Stream: l.Stream,
}, l.Timestamp)
}
}
return nil
}
func NormalizeWorkdir(workdir string) (string, error) {
if workdir == "" {
workdir = os.Getenv("DAGGER_WORKDIR")
}
if workdir == "" {
var err error
workdir, err = os.Getwd()
if err != nil {
return "", err
}
}
workdir, err := filepath.Abs(workdir)
if err != nil {
return "", err
}
return workdir, nil
}
func detectPlatform(ctx context.Context, c *bkclient.Client) (*specs.Platform, error) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | w, err := c.ListWorkers(ctx)
if err != nil {
return nil, fmt.Errorf("error detecting platform %w", err)
}
if len(w) > 0 && len(w[0].Platforms) > 0 {
dPlatform := w[0].Platforms[0]
return &dPlatform, nil
}
defaultPlatform := platforms.DefaultSpec()
return &defaultPlatform, nil
}
type AnyDirSource struct{}
func (AnyDirSource) LookupDir(name string) (filesync.SyncedDir, bool) {
return filesync.SyncedDir{
Dir: name,
Map: func(p string, st *fstypes.Stat) fsutil.MapResult {
st.Uid = 0
st.Gid = 0
return fsutil.MapResultKeep
},
}, true
}
func cacheConfigFromEnv() (string, map[string]string, error) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | envVal, ok := os.LookupEnv(engine.CacheConfigEnvName)
if !ok {
return "", nil, nil
}
kvs := strings.Split(envVal, ",")
if len(kvs) == 0 {
return "", nil, nil
}
attrs := make(map[string]string)
for _, kv := range kvs {
parts := strings.SplitN(kv, "=", 2)
if len(parts) != 2 {
return "", nil, errors.Errorf("invalid form for cache config %q", kv)
}
attrs[parts[0]] = parts[1]
}
typeVal, ok := attrs["type"]
if !ok {
return "", nil, errors.Errorf("missing type in cache config: %q", envVal)
}
delete(attrs, "type")
return typeVal, attrs, nil
}
func bk2progrock(event *bkclient.SolveStatus) *progrock.StatusUpdate { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | var status progrock.StatusUpdate
for _, v := range event.Vertexes {
vtx := &progrock.Vertex{
Id: v.Digest.String(),
Name: v.Name,
Cached: v.Cached,
}
if strings.Contains(v.Name, "[hide]") { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | vtx.Internal = true
}
for _, input := range v.Inputs {
vtx.Inputs = append(vtx.Inputs, input.String())
}
if v.Started != nil {
vtx.Started = timestamppb.New(*v.Started)
}
if v.Completed != nil {
vtx.Completed = timestamppb.New(*v.Completed)
}
if v.Error != "" {
if strings.HasSuffix(v.Error, context.Canceled.Error()) {
vtx.Canceled = true
} else {
msg := v.Error
vtx.Error = &msg
}
}
var custom pipeline.CustomName
if json.Unmarshal([]byte(v.Name), &custom) == nil {
vtx.Name = custom.Name
vtx.Internal = custom.Internal
}
status.Vertexes = append(status.Vertexes, vtx)
}
for _, s := range event.Statuses { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | task := &progrock.VertexTask{
Vertex: s.Vertex.String(),
Name: s.ID,
Total: s.Total,
Current: s.Current,
}
if s.Started != nil {
task.Started = timestamppb.New(*s.Started)
}
if s.Completed != nil {
task.Completed = timestamppb.New(*s.Completed)
}
status.Tasks = append(status.Tasks, task)
}
for _, s := range event.Logs {
status.Logs = append(status.Logs, &progrock.VertexLog{
Vertex: s.Vertex.String(),
Stream: progrock.LogStream(s.Stream),
Data: s.Data,
Timestamp: timestamppb.New(s.Timestamp),
})
}
return &status
}
func progrockForwarder(w progrock.Writer, rawOutput io.Writer) (string, progrock.Writer, func() error, error) {
parentDir := filepath.Join(
xdg.RuntimeDir,
"dagger",
)
err := os.MkdirAll(parentDir, 0700) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | engine/engine.go | if os.IsPermission(err) {
fallbackParentDir := filepath.Join(
xdg.CacheHome,
"dagger",
)
if rawOutput != nil {
fmt.Fprintf(rawOutput, "WARNING: unable to create dagger runtime dir %s, falling back to %s: %v\n", parentDir, fallbackParentDir, err)
}
if err := os.MkdirAll(fallbackParentDir, 0700); err != nil {
return "", nil, nil, err
}
parentDir = fallbackParentDir
} else if err != nil {
return "", nil, nil, err
}
progSock := filepath.Join(
parentDir,
fmt.Sprintf("progrock-%d.sock", time.Now().UnixNano()),
)
l, err := net.Listen("unix", progSock)
if err != nil {
return "", nil, nil, err
}
progW, err := progrock.ServeRPC(l, w)
if err != nil {
return "", nil, nil, err
}
return progSock, progW, l.Close, nil
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | internal/tui/vterm.go | package tui
import (
"bytes"
"fmt"
"io"
"os"
"strings"
"github.com/charmbracelet/bubbles/key"
tea "github.com/charmbracelet/bubbletea"
"github.com/muesli/termenv"
"github.com/vito/vt100"
)
type Vterm struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | internal/tui/vterm.go | vt *vt100.VT100
viewBuf *bytes.Buffer
Offset int
Height int
}
var debugVterm = os.Getenv("_DEBUG_VTERM") != ""
func NewVterm(width int) *Vterm {
vt := vt100.NewVT100(1, width)
vt.AutoResize = true
if debugVterm {
vt.DebugLogs = os.Stderr
}
return &Vterm{
vt: vt,
viewBuf: new(bytes.Buffer),
}
}
func (term *Vterm) Write(p []byte) (int, error) {
atBottom := term.Offset+term.Height >= term.vt.UsedHeight()
if term.Height == 0 {
atBottom = true
}
n, err := term.vt.Write(p)
if err != nil {
return n, err |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | internal/tui/vterm.go | }
if atBottom {
term.Offset = max(0, term.vt.UsedHeight()-term.Height)
}
return n, nil
}
func (term *Vterm) SetHeight(height int) {
atBottom := term.Offset+term.Height >= term.vt.UsedHeight()
term.Height = height
if atBottom {
term.Offset = max(0, term.vt.UsedHeight()-term.Height)
}
}
func (term *Vterm) SetWidth(width int) {
term.vt.Resize(term.vt.Height, width)
}
func (term *Vterm) Init() tea.Cmd {
return nil
}
func (term *Vterm) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
switch {
case key.Matches(msg, keys.Up):
term.Offset = max(0, term.Offset-1)
case key.Matches(msg, keys.Down):
term.Offset = min(term.vt.UsedHeight()-term.Height, term.Offset+1)
case key.Matches(msg, keys.PageUp):
term.Offset = max(0, term.Offset-term.Height)
case key.Matches(msg, keys.PageDown): |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | internal/tui/vterm.go | term.Offset = min(term.vt.UsedHeight()-term.Height, term.Offset+term.Height)
case key.Matches(msg, keys.Home):
term.Offset = 0
case key.Matches(msg, keys.End):
term.Offset = term.vt.UsedHeight() - term.Height
}
}
return term, nil
}
func (term *Vterm) ScrollPercent() float64 {
return min(1, float64(term.Offset+term.Height)/float64(term.vt.UsedHeight()))
}
const reset = termenv.CSI + termenv.ResetSeq + "m"
func (term *Vterm) View() string {
used := term.vt.UsedHeight()
buf := term.viewBuf
buf.Reset()
var lines int
for row, l := range term.vt.Content {
if row < term.Offset {
continue
}
if row+1 > (term.Offset + term.Height) {
break
}
var lastFormat vt100.Format
for col, r := range l {
f := term.vt.Format[row][col]
if f != lastFormat {
lastFormat = f |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | internal/tui/vterm.go | buf.Write([]byte(renderFormat(f)))
}
buf.Write([]byte(string(r)))
}
buf.Write([]byte(reset + "\n"))
lines++
if row > used {
break
}
}
for i := lines; i < term.Height; i++ {
buf.Write([]byte("\n"))
}
return buf.String()[0 : buf.Len()-1]
}
func (term *Vterm) Print(w io.Writer) error {
used := term.vt.UsedHeight()
for row, l := range term.vt.Content {
_, err := fmt.Fprintln(w, strings.TrimRight(string(l), " "))
if err != nil {
return err
}
if row > used {
break
}
}
return nil
}
func renderFormat(f vt100.Format) string { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | internal/tui/vterm.go | styles := []string{}
if f.Fg != nil {
styles = append(styles, f.Fg.Sequence(false))
}
if f.Bg != nil {
styles = append(styles, f.Bg.Sequence(true))
}
switch f.Intensity {
case vt100.Bold:
styles = append(styles, termenv.BoldSeq)
case vt100.Faint:
styles = append(styles, termenv.FaintSeq)
}
if f.Italic { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,185 | Need to turn TUI off | I want to be able to run `dagger run sh` to run commands against an open session. In this case the command Iβm running needs to be interactive so I need control over stdin, stdout and stderr.
This is also related to https://github.com/dagger/dagger/issues/5181 but Iβve wanted to turn it off for some reason multiple times when running our test suites. During tests you get a lot of failed pipelines but itβs okay because weβre making assertions on that, but it adds a lot of noise to the output. Sometimes when Iβm debugging, I just want to `Printf` some things and skip the whole TUI.
I tried to use a pipe or redirection so that `useTUI` is false:
https://github.com/dagger/dagger/blob/1d902d3f2e3bcc20765683602dbdff214ed012ac/cmd/dagger/engine.go#L20-L21
But it seems to swallow it π:
```shell
$ dagger run env | grep DAGGER
# TUI shows up and all env vars are returned
$ dagger run env > out.txt
# TUI shows up and out.txt is empty
```
\cc @vito | https://github.com/dagger/dagger/issues/5185 | https://github.com/dagger/dagger/pull/5218 | 83eca0f0516bbbfe969b562524d5dc29729b9698 | b71ccccb877cd67f434b51872d29473bfe53f243 | 2023-05-24T09:33:40Z | go | 2023-05-30T18:04:02Z | internal/tui/vterm.go | styles = append(styles, termenv.ItalicSeq)
}
if f.Underline {
styles = append(styles, termenv.UnderlineSeq)
}
if f.Blink {
styles = append(styles, termenv.BlinkSeq)
}
if f.Reverse {
styles = append(styles, termenv.ReverseSeq)
}
if f.Conceal {
styles = append(styles, "8")
}
if f.CrossOut {
styles = append(styles, termenv.CrossOutSeq)
}
if f.Overline {
styles = append(styles, termenv.OverlineSeq)
}
var res string
if f.Reset || f == (vt100.Format{}) {
res = reset
}
if len(styles) > 0 {
res += fmt.Sprintf("%s%sm", termenv.CSI, strings.Join(styles, ";"))
}
return res
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,205 | π `dagger listen` stopped working in v0.6.0 release | ### What is the issue?
`dagger listen` doesn't work anymore since starting from v0.6.0, it starts the TUI instead of executing the actual `listen` command
### Log output

### Steps to reproduce
run `dagger listen`
### SDK version
Engine v0.6.0
### OS version
N/A | https://github.com/dagger/dagger/issues/5205 | https://github.com/dagger/dagger/pull/5219 | 2dd8717ee0c09230dbc2d9bee5d3f6343e8ccd36 | 7a48b9b25a612d3568f198e17fb3e3889219b276 | 2023-05-26T02:20:22Z | go | 2023-05-31T21:54:07Z | cmd/dagger/listen.go | package main
import (
"context"
"fmt"
"net/http"
"os"
"github.com/dagger/dagger/engine"
"github.com/dagger/dagger/router"
"github.com/spf13/cobra"
)
var (
listenAddress string
disableHostRW bool
)
var listenCmd = &cobra.Command{
Use: "listen",
Aliases: []string{"l"},
Run: Listen,
Hidden: true,
Short: "Starts the engine server",
}
func init() { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,205 | π `dagger listen` stopped working in v0.6.0 release | ### What is the issue?
`dagger listen` doesn't work anymore since starting from v0.6.0, it starts the TUI instead of executing the actual `listen` command
### Log output

### Steps to reproduce
run `dagger listen`
### SDK version
Engine v0.6.0
### OS version
N/A | https://github.com/dagger/dagger/issues/5205 | https://github.com/dagger/dagger/pull/5219 | 2dd8717ee0c09230dbc2d9bee5d3f6343e8ccd36 | 7a48b9b25a612d3568f198e17fb3e3889219b276 | 2023-05-26T02:20:22Z | go | 2023-05-31T21:54:07Z | cmd/dagger/listen.go | listenCmd.Flags().StringVarP(&listenAddress, "listen", "", "127.0.0.1:8080", "Listen on network address ADDR")
listenCmd.Flags().BoolVar(&disableHostRW, "disable-host-read-write", false, "disable host read/write access")
}
func Listen(cmd *cobra.Command, args []string) {
ctx := context.Background()
if err := withEngineAndTUI(ctx, engine.Config{}, func(ctx context.Context, r *router.Router) error {
fmt.Fprintf(os.Stderr, "==> server listening on http://%s/query\n", listenAddress)
return http.ListenAndServe(listenAddress, r)
}); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/engine.go | package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"os"
tea "github.com/charmbracelet/bubbletea"
"github.com/dagger/dagger/engine"
internalengine "github.com/dagger/dagger/internal/engine"
"github.com/dagger/dagger/internal/tui"
"github.com/dagger/dagger/router"
"github.com/mattn/go-isatty"
"github.com/vito/progrock"
)
var silent bool
func init() {
rootCmd.PersistentFlags().BoolVarP(
&silent,
"silent",
"s",
!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsTerminal(os.Stderr.Fd()),
"disable terminal UI and progress output",
)
}
var interactive = os.Getenv("_EXPERIMENTAL_DAGGER_INTERACTIVE_TUI") != ""
func withEngineAndTUI( |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/engine.go | ctx context.Context,
engineConf engine.Config,
fn engine.StartCallback,
) error {
if engineConf.Workdir == "" {
engineConf.Workdir = workdir
}
if engineConf.RunnerHost == "" {
engineConf.RunnerHost = internalengine.RunnerHost()
}
engineConf.DisableHostRW = disableHostRW
if engineConf.JournalFile == "" {
engineConf.JournalFile = os.Getenv("_EXPERIMENTAL_DAGGER_JOURNAL")
}
if silent {
if engineConf.LogOutput == nil {
engineConf.LogOutput = os.Stderr
}
return engine.Start(ctx, engineConf, fn)
}
if interactive {
return interactiveTUI(ctx, engineConf, fn)
}
return inlineTUI(ctx, engineConf, fn)
}
func progrockTee(progW progrock.Writer) (progrock.Writer, error) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/engine.go | if log := os.Getenv("_EXPERIMENTAL_DAGGER_PROGROCK_JOURNAL"); log != "" {
fileW, err := newProgrockWriter(log)
if err != nil {
return nil, fmt.Errorf("open progrock log: %w", err)
}
return progrock.MultiWriter{progW, fileW}, nil
}
return progW, nil
}
func interactiveTUI( |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/engine.go | ctx context.Context,
engineConf engine.Config,
fn engine.StartCallback,
) error {
progR, progW := progrock.Pipe()
progW, err := progrockTee(progW)
if err != nil {
return err
}
engineConf.ProgrockWriter = progW
ctx, quit := context.WithCancel(ctx)
defer quit()
program := tea.NewProgram(tui.New(quit, progR), tea.WithAltScreen())
tuiDone := make(chan error, 1)
go func() {
_, err := program.Run()
tuiDone <- err
}()
var cbErr error
engineErr := engine.Start(ctx, engineConf, func(ctx context.Context, api *router.Router) error {
cbErr = fn(ctx, api)
return cbErr
})
if cbErr != nil {
return cbErr
}
tuiErr := <-tuiDone
return errors.Join(tuiErr, engineErr) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/engine.go | }
func inlineTUI(
ctx context.Context,
engineConf engine.Config,
fn engine.StartCallback,
) error {
tape := progrock.NewTape()
if debugLogs {
tape.ShowInternal(true)
}
progW, engineErr := progrockTee(tape)
if engineErr != nil {
return engineErr
}
engineConf.ProgrockWriter = progW
ctx, quit := context.WithCancel(ctx)
defer quit()
stop := progrock.DefaultUI().RenderLoop(quit, tape, os.Stderr, true)
defer stop()
var cbErr error
engineErr = engine.Start(ctx, engineConf, func(ctx context.Context, api *router.Router) error {
cbErr = fn(ctx, api)
return cbErr
})
if cbErr != nil {
return cbErr
}
return engineErr
}
func newProgrockWriter(dest string) (progrock.Writer, error) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/engine.go | f, err := os.Create(dest)
if err != nil {
return nil, err
}
return progrockFileWriter{
enc: json.NewEncoder(f),
c: f,
}, nil
}
type progrockFileWriter struct {
enc *json.Encoder
c io.Closer
}
var _ progrock.Writer = progrockFileWriter{}
func (p progrockFileWriter) WriteStatus(update *progrock.StatusUpdate) error {
return p.enc.Encode(update)
}
func (p progrockFileWriter) Close() error {
return p.c.Close()
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/run.go | package main
import (
"context"
"errors"
"fmt"
"net"
"net/http"
"os"
"os/exec"
"strings"
"time"
"github.com/dagger/dagger/engine"
"github.com/dagger/dagger/router"
"github.com/google/uuid"
"github.com/spf13/cobra"
"github.com/vito/progrock"
)
var runCmd = &cobra.Command{
Use: "run [command]",
Aliases: []string{"r"},
DisableFlagsInUseLine: true,
Long: `Runs the specified command in a Dagger session and shows progress in a TUI
DAGGER_SESSION_PORT and DAGGER_SESSION_TOKEN will be convieniently injected automatically.`, |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/run.go | Short: "Runs a command in a Dagger session",
Example: ` Run a Dagger pipeline written in Go:
dagger run go run main.go
Run a Dagger pipeline written in Node.js:
dagger run node index.mjs
Run a Dagger pipeline written in Python:
dagger run python main.py
Run a Dagger API request directly:
jq -n '{query:"{container{id}}"}' | \
dagger run sh -c 'curl -s \
-u $DAGGER_SESSION_TOKEN: \
-H "content-type:application/json" \
-d @- \
http://127.0.0.1:$DAGGER_SESSION_PORT/query'`,
Run: Run,
Args: cobra.MinimumNArgs(1),
SilenceUsage: true,
}
var waitDelay time.Duration
func init() {
runCmd.Flags().SetInterspersed(false)
runCmd.Flags().DurationVar(
&waitDelay,
"cleanup-timeout",
10*time.Second,
"max duration to wait between SIGTERM and SIGKILL on interrupt",
)
}
func Run(cmd *cobra.Command, args []string) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/run.go | ctx := context.Background()
err := run(ctx, args)
if err != nil {
if errors.Is(err, context.Canceled) {
fmt.Fprintln(os.Stderr, "run canceled")
os.Exit(2)
return
}
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
return
}
}
func run(ctx context.Context, args []string) error {
u, err := uuid.NewRandom()
if err != nil {
return fmt.Errorf("generate uuid: %w", err)
}
sessionToken := u.String()
return withEngineAndTUI(ctx, engine.Config{
SessionToken: sessionToken,
}, func(ctx context.Context, api *router.Router) error {
sessionL, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
return fmt.Errorf("session listen: %w", err)
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,196 | β¨ `dagger run` does not print the running program's stdout | ### What are you trying to do?
Weird use-case I'm sure but I have a Dagger pipeline ran using 'go run ./cmd', which prints some data to stdout, which we are writing to a file.
```
go run ./cmd > out.txt
```
When we use `dagger run` with this, it doesn't print anything.
### Why is this important to you?
There's probably a lot of weird cases where one would want your porgram's stdout to be piped to another program or to be written to a file. We are using it to write down the file paths of objects that are created by the pipeline where other processes will be used to copy them.
### How are you currently working around this?
We're just not using 'dagger run' for this at the moment.
---
I don't necessarily think this is a bug. | https://github.com/dagger/dagger/issues/5196 | https://github.com/dagger/dagger/pull/5231 | dfc9063a109d00b5831862e7e549e25718d08815 | e4bbec135098db82515c8b1033b820b888d2e125 | 2023-05-25T16:10:02Z | go | 2023-06-01T13:21:27Z | cmd/dagger/run.go | defer sessionL.Close()
sessionPort := fmt.Sprintf("%d", sessionL.Addr().(*net.TCPAddr).Port)
os.Setenv("DAGGER_SESSION_PORT", sessionPort)
os.Setenv("DAGGER_SESSION_TOKEN", sessionToken)
subCmd := exec.CommandContext(ctx, args[0], args[1:]...)
subCmd.Stdin = os.Stdin
ensureChildProcessesAreKilled(subCmd)
go http.Serve(sessionL, api)
var cmdErr error
if !silent {
rec := progrock.RecorderFromContext(ctx)
cmdline := strings.Join(subCmd.Args, " ")
cmdVtx := rec.Vertex("cmd", cmdline)
subCmd.Stdout = cmdVtx.Stdout()
subCmd.Stderr = cmdVtx.Stderr()
cmdErr = subCmd.Run()
cmdVtx.Done(cmdErr)
} else {
subCmd.Stdout = os.Stdout
subCmd.Stderr = os.Stderr
cmdErr = subCmd.Run()
}
return cmdErr
})
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/engine.go | package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"os"
tea "github.com/charmbracelet/bubbletea"
"github.com/dagger/dagger/engine"
internalengine "github.com/dagger/dagger/internal/engine"
"github.com/dagger/dagger/internal/tui"
"github.com/dagger/dagger/router"
"github.com/mattn/go-isatty"
"github.com/vito/progrock"
)
var silent bool
var stdoutIsTTY = isatty.IsTerminal(os.Stdout.Fd())
var stderrIsTTY = isatty.IsTerminal(os.Stderr.Fd())
func init() {
rootCmd.PersistentFlags().BoolVarP(
&silent,
"silent",
"s",
!stdoutIsTTY && !stderrIsTTY,
"disable terminal UI and progress output",
)
}
var interactive = os.Getenv("_EXPERIMENTAL_DAGGER_INTERACTIVE_TUI") != ""
func withEngineAndTUI( |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/engine.go | ctx context.Context,
engineConf engine.Config,
fn engine.StartCallback,
) error {
if engineConf.Workdir == "" {
engineConf.Workdir = workdir
}
if engineConf.RunnerHost == "" {
engineConf.RunnerHost = internalengine.RunnerHost()
}
engineConf.DisableHostRW = disableHostRW
if engineConf.JournalFile == "" {
engineConf.JournalFile = os.Getenv("_EXPERIMENTAL_DAGGER_JOURNAL")
}
if silent {
if engineConf.LogOutput == nil {
engineConf.LogOutput = os.Stderr
}
return engine.Start(ctx, engineConf, fn)
}
if interactive {
return interactiveTUI(ctx, engineConf, fn)
}
return inlineTUI(ctx, engineConf, fn)
}
func progrockTee(progW progrock.Writer) (progrock.Writer, error) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/engine.go | if log := os.Getenv("_EXPERIMENTAL_DAGGER_PROGROCK_JOURNAL"); log != "" {
fileW, err := newProgrockWriter(log)
if err != nil {
return nil, fmt.Errorf("open progrock log: %w", err)
}
return progrock.MultiWriter{progW, fileW}, nil
}
return progW, nil
}
func interactiveTUI( |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/engine.go | ctx context.Context,
engineConf engine.Config,
fn engine.StartCallback,
) error {
progR, progW := progrock.Pipe()
progW, err := progrockTee(progW)
if err != nil {
return err
}
engineConf.ProgrockWriter = progW
ctx, quit := context.WithCancel(ctx)
defer quit()
program := tea.NewProgram(tui.New(quit, progR), tea.WithAltScreen())
tuiDone := make(chan error, 1)
go func() {
_, err := program.Run()
tuiDone <- err
}()
var cbErr error
engineErr := engine.Start(ctx, engineConf, func(ctx context.Context, api *router.Router) error {
cbErr = fn(ctx, api)
return cbErr
})
if cbErr != nil {
return cbErr
}
tuiErr := <-tuiDone
return errors.Join(tuiErr, engineErr) |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/engine.go | }
func inlineTUI(
ctx context.Context,
engineConf engine.Config,
fn engine.StartCallback,
) error {
tape := progrock.NewTape()
if debug {
tape.ShowInternal(true)
}
progW, engineErr := progrockTee(tape)
if engineErr != nil {
return engineErr
}
engineConf.ProgrockWriter = progW
ctx, quit := context.WithCancel(ctx)
defer quit()
stop := progrock.DefaultUI().RenderLoop(quit, tape, os.Stderr, true)
defer stop()
var cbErr error
engineErr = engine.Start(ctx, engineConf, func(ctx context.Context, api *router.Router) error {
cbErr = fn(ctx, api)
return cbErr
})
if cbErr != nil {
return cbErr
}
return engineErr
}
func newProgrockWriter(dest string) (progrock.Writer, error) { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/engine.go | f, err := os.Create(dest)
if err != nil {
return nil, err
}
return progrockFileWriter{
enc: json.NewEncoder(f),
c: f,
}, nil
}
type progrockFileWriter struct {
enc *json.Encoder
c io.Closer
}
var _ progrock.Writer = progrockFileWriter{}
func (p progrockFileWriter) WriteStatus(update *progrock.StatusUpdate) error {
return p.enc.Encode(update)
}
func (p progrockFileWriter) Close() error {
return p.c.Close()
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/run.go | package main
import (
"context"
"errors"
"fmt"
"net"
"net/http"
"os"
"os/exec"
"strings"
"time"
"github.com/dagger/dagger/engine"
"github.com/dagger/dagger/router" |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/run.go | "github.com/google/uuid"
"github.com/spf13/cobra"
"github.com/vito/progrock"
)
var runCmd = &cobra.Command{
Use: "run [command]",
Aliases: []string{"r"},
DisableFlagsInUseLine: true,
Long: `Runs the specified command in a Dagger session and shows progress in a TUI
DAGGER_SESSION_PORT and DAGGER_SESSION_TOKEN will be convieniently injected automatically.`,
Short: "Runs a command in a Dagger session",
Example: ` Run a Dagger pipeline written in Go:
dagger run go run main.go
Run a Dagger pipeline written in Node.js:
dagger run node index.mjs
Run a Dagger pipeline written in Python:
dagger run python main.py
Run a Dagger API request directly:
jq -n '{query:"{container{id}}"}' | \
dagger run sh -c 'curl -s \
-u $DAGGER_SESSION_TOKEN: \
-H "content-type:application/json" \
-d @- \
http://127.0.0.1:$DAGGER_SESSION_PORT/query'`,
Run: Run,
Args: cobra.MinimumNArgs(1),
SilenceUsage: true,
}
var waitDelay time.Duration
func init() { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/run.go | runCmd.Flags().SetInterspersed(false)
runCmd.Flags().DurationVar(
&waitDelay,
"cleanup-timeout",
10*time.Second,
"max duration to wait between SIGTERM and SIGKILL on interrupt",
)
}
func Run(cmd *cobra.Command, args []string) {
ctx := context.Background()
err := run(ctx, args)
if err != nil {
if errors.Is(err, context.Canceled) {
fmt.Fprintln(os.Stderr, "run canceled")
os.Exit(2)
return
}
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
return
}
}
func run(ctx context.Context, args []string) error { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/run.go | u, err := uuid.NewRandom()
if err != nil {
return fmt.Errorf("generate uuid: %w", err)
}
sessionToken := u.String()
return withEngineAndTUI(ctx, engine.Config{
SessionToken: sessionToken,
}, func(ctx context.Context, api *router.Router) error {
sessionL, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
return fmt.Errorf("session listen: %w", err)
}
defer sessionL.Close()
sessionPort := fmt.Sprintf("%d", sessionL.Addr().(*net.TCPAddr).Port)
os.Setenv("DAGGER_SESSION_PORT", sessionPort)
os.Setenv("DAGGER_SESSION_TOKEN", sessionToken)
subCmd := exec.CommandContext(ctx, args[0], args[1:]...)
subCmd.Stdin = os.Stdin |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | cmd/dagger/run.go | ensureChildProcessesAreKilled(subCmd)
go http.Serve(sessionL, api)
var cmdErr error
if !silent {
rec := progrock.RecorderFromContext(ctx)
cmdline := strings.Join(subCmd.Args, " ")
cmdVtx := rec.Vertex("cmd", cmdline)
if stdoutIsTTY {
subCmd.Stdout = cmdVtx.Stdout()
} else {
subCmd.Stdout = os.Stdout
}
if stderrIsTTY {
subCmd.Stderr = cmdVtx.Stderr()
} else {
subCmd.Stderr = os.Stderr
}
cmdErr = subCmd.Run()
cmdVtx.Done(cmdErr)
} else {
subCmd.Stdout = os.Stdout
subCmd.Stderr = os.Stderr
cmdErr = subCmd.Run()
}
return cmdErr
})
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | package tui
import (
"bytes"
"fmt"
"os"
"path/filepath"
"sort"
"strings"
"time"
"github.com/charmbracelet/bubbles/progress"
"github.com/charmbracelet/bubbles/spinner"
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/tonistiigi/units"
"github.com/vito/progrock"
)
func NewItem(v *progrock.Vertex, width int) *Item { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | saneName := strings.Join(strings.Fields(v.Name), " ")
return &Item{
id: v.Id,
inputs: v.Inputs,
name: saneName,
logs: &bytes.Buffer{},
logsModel: NewVterm(width),
tasksModel: viewport.New(width, 1),
spinner: newSpinner(),
width: width,
}
}
var _ TreeEntry = &Item{}
type Item struct { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | id string
inputs []string
name string
started *time.Time
completed *time.Time
cached bool
error *string
logs *bytes.Buffer
logsModel *Vterm
tasks []*progrock.VertexTask
tasksModel viewport.Model
internal bool
spinner spinner.Model
width int
isInfinite bool
}
func (i *Item) ID() string { return i.id }
func (i *Item) Inputs() []string { return i.inputs }
func (i *Item) Name() string { return i.name } |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | func (i *Item) Internal() bool { return i.internal }
func (i *Item) Entries() []TreeEntry { return nil }
func (i *Item) Started() *time.Time { return i.started }
func (i *Item) Completed() *time.Time { return i.completed }
func (i *Item) Cached() bool { return i.cached }
func (i *Item) Infinite() bool { return i.isInfinite }
func (i *Item) Error() *string {
return i.error
}
func (i *Item) Save(dir string) (string, error) {
filePath := filepath.Join(dir, sanitizeFilename(i.Name())) + ".log"
f, err := os.Create(filePath)
if err != nil {
return "", fmt.Errorf("save item to %s as %s: %w", dir, filePath, err)
}
if err := i.logsModel.Print(f); err != nil {
return "", err
}
if err := f.Close(); err != nil {
return "", err
}
return filePath, nil
}
func (i *Item) Open() tea.Cmd {
dir, err := os.MkdirTemp("", "dagger-logs.*")
if err != nil {
return func() tea.Msg {
return EditorExitMsg{err}
}
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | filePath, err := i.Save(dir)
if err != nil {
return func() tea.Msg {
return EditorExitMsg{err}
}
}
return openEditor(filePath)
}
func (i *Item) UpdateVertex(v *progrock.Vertex) {
if i.started == nil && v.Started != nil {
t := v.Started.AsTime()
i.started = &t
}
if v.Completed != nil {
t := v.Completed.AsTime()
i.completed = &t
}
i.cached = v.Cached
i.error = v.Error
}
func (i *Item) UpdateLog(log *progrock.VertexLog) {
i.logsModel.Write(log.Data)
}
func (i *Item) UpdateStatus(task *progrock.VertexTask) {
var current = -1
for i, s := range i.tasks {
if s.Name == task.Name {
current = i |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | break
}
}
if current == -1 {
i.tasks = append(i.tasks, task)
} else {
i.tasks[current] = task
}
}
var _ tea.Model = &Item{}
func (i *Item) Init() tea.Cmd {
return i.spinner.Tick
}
func (i *Item) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case spinner.TickMsg:
spinnerM, cmd := i.spinner.Update(msg)
i.spinner = spinnerM
return i, cmd
default:
if len(i.tasks) > 0 {
statusM, cmd := i.tasksModel.Update(msg)
i.tasksModel = statusM
return i, cmd
}
vtermM, cmd := i.logsModel.Update(msg)
i.logsModel = vtermM.(*Vterm)
return i, cmd
}
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | func (i *Item) View() string {
if len(i.tasks) > 0 {
i.tasksModel.SetContent(i.tasksView())
return i.tasksModel.View()
}
return i.logsModel.View()
}
func (i *Item) SetHeight(height int) {
i.logsModel.SetHeight(height)
i.tasksModel.Height = height
}
func (i *Item) SetWidth(width int) {
i.width = width
i.logsModel.SetWidth(width)
i.tasksModel.Width = width
}
func (i *Item) ScrollPercent() float64 {
if len(i.tasks) > 0 {
return i.tasksModel.ScrollPercent()
}
return i.logsModel.ScrollPercent()
}
func (i *Item) tasksView() string {
tasks := []string{}
bar := progress.New(progress.WithSolidFill("2"))
bar.Width = i.width / 4
for _, t := range i.tasks {
status := completedStatus.String() + " "
if t.Completed == nil {
status = i.spinner.View() + " " |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | }
name := t.Name
progress := ""
if t.Total != 0 {
progress = fmt.Sprintf("%.2f / %.2f", units.Bytes(t.Current), units.Bytes(t.Total))
progress += " " + bar.ViewAs(float64(t.Current)/float64(t.Total))
} else if t.Current != 0 {
progress = fmt.Sprintf("%.2f", units.Bytes(t.Current))
}
pad := strings.Repeat(" ", max(0, i.width-lipgloss.Width(status)-lipgloss.Width(name)-lipgloss.Width(progress)))
view := status + name + pad + progress
tasks = append(tasks, view)
}
return strings.Join(tasks, "\n")
}
type groupModel interface {
tea.Model
SetHeight(int)
SetWidth(int)
ScrollPercent() float64
Save(dir string) (string, error)
}
type Group struct {
groupModel
id string
name string
entries []TreeEntry
entriesByID map[string]TreeEntry
}
func NewGroup(id, name string) *Group { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | return &Group{
groupModel: &emptyGroup{},
id: id,
name: name,
entries: []TreeEntry{},
entriesByID: map[string]TreeEntry{},
}
}
var _ TreeEntry = &Group{}
func (g *Group) ID() string {
return g.id
}
func (g *Group) Inputs() []string {
return nil
}
func (g *Group) Name() string {
return g.name
}
func (g *Group) Entries() []TreeEntry {
return g.entries
}
func (g *Group) Save(dir string) (string, error) {
subDir := filepath.Join(dir, sanitizeFilename(g.Name()))
if err := os.MkdirAll(subDir, 0700); err != nil {
return "", err
}
if _, err := g.groupModel.Save(subDir); err != nil { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | return "", err
}
for _, e := range g.entries {
if _, err := e.Save(subDir); err != nil {
return "", err
}
}
return subDir, nil
}
func (g *Group) Open() tea.Cmd {
dir, err := os.MkdirTemp("", "dagger-logs.*")
if err != nil {
return func() tea.Msg { return EditorExitMsg{err} }
}
subDir, err := g.Save(dir)
if err != nil {
return func() tea.Msg { return EditorExitMsg{err} }
}
return openEditor(subDir)
}
func (g *Group) Add(e TreeEntry) {
_, has := g.entriesByID[e.ID()]
if has {
return
}
g.entriesByID[e.ID()] = e
g.entries = append(g.entries, e)
g.sort()
}
func (g *Group) Cached() bool { |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | for _, e := range g.entries {
if !e.Cached() {
return false
}
}
return true
}
func (g *Group) Error() *string {
for _, e := range g.entries {
if e.Error() != nil {
return e.Error()
}
}
return nil
}
func (g *Group) Infinite() bool {
return false
}
func (g *Group) Started() *time.Time {
timers := []*time.Time{}
for _, e := range g.entries {
timers = append(timers, e.Started())
}
sort.Slice(timers, func(i, j int) bool {
if timers[i] == nil {
return false
}
if timers[j] == nil {
return true
} |
closed | dagger/dagger | https://github.com/dagger/dagger | 5,191 | π TUI display incorrect when sdk crash with exception | ### What is the issue?
From https://github.com/wingyplus/kaogeek-discord-bot/tree/dagger/deployment
I accidentally set export to `docker.io/kaogeek` and found crash when running in auto provisioning mode. When running with TUI feature I see all pass at first but it hide the crash log in the first step and step export not show in the TUI. I expected to see the step is a failure at least and may show the export step failure, this could spot the problems more easier.
### Log output
Auto provisioning mode:
```
file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144
throw new GraphQLRequestError("Error message", {
^
GraphQLRequestError: Error message
at file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:144:23
at Generator.throw (<anonymous>)
at rejected (file:///Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/node_modules/.pnpm/@dagger.io+dagger@0.5.3/node_modules/@dagger.io/dagger/dist/api/utils.js:5:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: ClientError: open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory: {"response":{"data":null,"errors":[{"message":"open /Users/thanabodee/src/github.com/creatorsgarten/kaogeek-discord-bot/deployment/docker.io/kaogeek: no such file or directory","locations":[{"line":2,"column":58719}],"path":....
```
TUI:
<img width="1915" alt="Screenshot 2566-05-25 at 09 57 48" src="https://github.com/dagger/dagger/assets/484530/47d5de01-a842-41cc-81a0-40d833afffd0">
### Steps to reproduce
Provisioning mode run by `pnpm build`. And TUI mode run with `_EXPERIMENT_DAGGER_TUI=1 dagger run pnpm run build`.
### SDK version
nodjs sdk 0.5.3
### OS version
macOS 13.1 (22C65) | https://github.com/dagger/dagger/issues/5191 | https://github.com/dagger/dagger/pull/5232 | b267d5999a927ba73e7978f0938fc827eb642c9c | 6d75e9b34a4bf70f454e201849998f34713352db | 2023-05-25T03:17:54Z | go | 2023-06-01T18:17:32Z | internal/tui/item.go | return timers[i].Before(*timers[j])
})
if len(timers) == 0 {
return nil
}
return timers[0]
}
func (g *Group) Completed() *time.Time {
timers := []*time.Time{}
for _, e := range g.entries {
timers = append(timers, e.Completed())
}
sort.Slice(timers, func(i, j int) bool {
if timers[i] == nil {
return false
}
if timers[j] == nil {
return true
}
return timers[i].Before(*timers[j])
})
if len(timers) == 0 {
return nil
}
return timers[len(timers)-1]
}
func (g *Group) SetWidth(w int) {
g.groupModel.SetWidth(w)
}
func (g *Group) Update(msg tea.Msg) (tea.Model, tea.Cmd) { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.