Merge pull request #1183 from aluzzardi/engine-pkg

stdlib: move core definitions to engine package
This commit is contained in:
Andrea Luzzardi 2021-12-07 14:13:09 -08:00 committed by GitHub
commit 4dd72b78a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 44 additions and 77 deletions

View File

@ -15,6 +15,7 @@
- [azure/staticwebapp](./azure/staticwebapp.md) - - - [azure/staticwebapp](./azure/staticwebapp.md) - -
- [azure/storage](./azure/storage.md) - - - [azure/storage](./azure/storage.md) - -
- [dagger](./dagger/README.md) - Dagger core types - [dagger](./dagger/README.md) - Dagger core types
- [dagger/engine](./dagger/engine.md) - -
- [dagger/op](./dagger/op.md) - op: low-level operations for Dagger processing pipelines - [dagger/op](./dagger/op.md) - op: low-level operations for Dagger processing pipelines
- [docker](./docker/README.md) - Docker container operations - [docker](./docker/README.md) - Docker container operations
- [docker/compose](./docker/compose.md) - Docker-compose operations - [docker/compose](./docker/compose.md) - Docker-compose operations

View File

@ -10,40 +10,6 @@ Dagger core types
import "alpha.dagger.io/dagger" import "alpha.dagger.io/dagger"
``` ```
## dagger.#Context
### dagger.#Context Inputs
_No input._
### dagger.#Context Outputs
_No output._
## dagger.#FS
A reference to a filesystem tree. For example: - The root filesystem of a container - A source code repository - A directory containing binary artifacts Rule of thumb: if it fits in a tar archive, it fits in a #FS.
### dagger.#FS Inputs
_No input._
### dagger.#FS Outputs
_No output._
## dagger.#Plan
A deployment plan executed by `dagger up`
### dagger.#Plan Inputs
_No input._
### dagger.#Plan Outputs
_No output._
## dagger.#Secret ## dagger.#Secret
A reference to an external secret, for example: - A password - A SSH private key - An API token Secrets are never merged in the Cue tree. They can only be used by a special filesystem mount designed to minimize leak risk. A reference to an external secret, for example: - A password - A SSH private key - An API token Secrets are never merged in the Cue tree. They can only be used by a special filesystem mount designed to minimize leak risk.
@ -56,18 +22,6 @@ _No input._
_No output._ _No output._
## dagger.#Service
A reference to a network service endpoint, for example: - A TCP or UDP port - A unix or npipe socket - An HTTPS endpoint
### dagger.#Service Inputs
_No input._
### dagger.#Service Outputs
_No output._
## dagger.#Stream ## dagger.#Stream
Dagger stream. Can be mounted as a UNIX socket. Dagger stream. Can be mounted as a UNIX socket.

View File

@ -13,7 +13,7 @@ import (
var ( var (
fsIDPath = cue.MakePath( fsIDPath = cue.MakePath(
cue.Hid("_fs", stdlib.PackageName), cue.Hid("_fs", stdlib.EnginePackage),
cue.Str("id"), cue.Str("id"),
) )
) )

View File

@ -11,7 +11,7 @@ import (
var ( var (
secretIDPath = cue.MakePath( secretIDPath = cue.MakePath(
cue.Hid("_secret", stdlib.PackageName), cue.Hid("_secret", stdlib.EnginePackage),
cue.Str("id"), cue.Str("id"),
) )
) )

View File

@ -11,7 +11,7 @@ import (
var ( var (
serviceIDPath = cue.MakePath( serviceIDPath = cue.MakePath(
cue.Hid("_service", stdlib.PackageName), cue.Hid("_service", stdlib.EnginePackage),
cue.Str("id"), cue.Str("id"),
) )
) )

View File

@ -3,18 +3,9 @@ package dagger
import ( import (
"alpha.dagger.io/dagger/op" "alpha.dagger.io/dagger/op"
"alpha.dagger.io/dagger/engine"
) )
// A reference to a filesystem tree.
// For example:
// - The root filesystem of a container
// - A source code repository
// - A directory containing binary artifacts
// Rule of thumb: if it fits in a tar archive, it fits in a #FS.
#FS: {
_fs: id: string
}
// An artifact such as source code checkout, container image, binary archive... // An artifact such as source code checkout, container image, binary archive...
// May be passed as user input, or computed by a buildkit pipeline // May be passed as user input, or computed by a buildkit pipeline
#Artifact: { #Artifact: {
@ -24,17 +15,8 @@ import (
... ...
} }
// A reference to a network service endpoint, for example:
// - A TCP or UDP port
// - A unix or npipe socket
// - An HTTPS endpoint
#Service: {
_service: id: string
}
// Dagger stream. Can be mounted as a UNIX socket. // Dagger stream. Can be mounted as a UNIX socket.
// FIXME: Deprecated. For backward compatibility only, use #Service instead. #Stream: engine.#Service
#Stream: #Service
// A reference to an external secret, for example: // A reference to an external secret, for example:
// - A password // - A password
@ -42,9 +24,7 @@ import (
// - An API token // - An API token
// Secrets are never merged in the Cue tree. They can only be used // Secrets are never merged in the Cue tree. They can only be used
// by a special filesystem mount designed to minimize leak risk. // by a special filesystem mount designed to minimize leak risk.
#Secret: { #Secret: engine.#Secret
_secret: id: string
}
#Input: { #Input: {
@dagger(input) @dagger(input)

View File

@ -0,0 +1,11 @@
package engine
// A reference to a filesystem tree.
// For example:
// - The root filesystem of a container
// - A source code repository
// - A directory containing binary artifacts
// Rule of thumb: if it fits in a tar archive, it fits in a #FS.
#FS: {
_fs: id: string
}

View File

@ -1,4 +1,4 @@
package dagger package engine
// A deployment plan executed by `dagger up` // A deployment plan executed by `dagger up`
#Plan: { #Plan: {

View File

@ -0,0 +1,11 @@
package engine
// A reference to an external secret, for example:
// - A password
// - A SSH private key
// - An API token
// Secrets are never merged in the Cue tree. They can only be used
// by a special filesystem mount designed to minimize leak risk.
#Secret: {
_secret: id: string
}

View File

@ -0,0 +1,9 @@
package engine
// A reference to a network service endpoint, for example:
// - A TCP or UDP port
// - A unix or npipe socket
// - An HTTPS endpoint
#Service: {
_service: id: string
}

View File

@ -17,10 +17,11 @@ var (
//go:embed **/*.cue **/*/*.cue //go:embed **/*.cue **/*/*.cue
FS embed.FS FS embed.FS
ModuleName = "alpha.dagger.io" ModuleName = "alpha.dagger.io"
PackageName = fmt.Sprintf("%s/dagger", ModuleName) PackageName = fmt.Sprintf("%s/dagger", ModuleName)
Path = path.Join("cue.mod", "pkg", ModuleName) EnginePackage = fmt.Sprintf("%s/engine", PackageName)
lockFilePath = path.Join("cue.mod", "dagger.lock") Path = path.Join("cue.mod", "pkg", ModuleName)
lockFilePath = path.Join("cue.mod", "dagger.lock")
) )
func Vendor(ctx context.Context, mod string) error { func Vendor(ctx context.Context, mod string) error {