testing a full build

This commit is contained in:
greg stone
2023-03-01 12:42:17 +00:00
parent e8babbf8e8
commit ea7a5d690a
8 changed files with 92 additions and 67 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"git-indra.lan/indra-labs/indra/pkg/docker"
"github.com/docker/docker/api/types"
)
var (
@@ -72,25 +73,25 @@ var buildConfigurations = []docker.BuildConfiguration{
// PullParent: false,
// },
//},
//docker.BuildConfiguration{
// Name: defaultRepositoryName + "/" + "indra-build",
// ContextFilePath: "/tmp/indra-build.tar",
// BuildOpts: types.ImageBuildOptions{
// Dockerfile: "docker/build/build.Dockerfile",
// Tags: []string{
// "dev",
// },
// BuildArgs: map[string]*string{
// "source_image": strPtr("indralabs/indra-source"),
// "source_version": strPtr("dev"),
// "builder_image": strPtr(defaultBuilderContainer),
// "target_name": strPtr("indra"),
// "target_build_script": strPtr("docker/build/targets/indra.sh"),
// },
// SuppressOutput: false,
// Remove: true,
// ForceRemove: true,
// PullParent: false,
// },
//},
docker.BuildConfiguration{
Name: defaultRepositoryName + "/" + "indra-build",
ContextFilePath: "/tmp/indra-build.tar",
BuildOpts: types.ImageBuildOptions{
Dockerfile: "docker/build/build.Dockerfile",
Tags: []string{
"dev",
},
BuildArgs: map[string]*string{
"source_image": strPtr("indralabs/indra-source"),
"source_version": strPtr("dev"),
"builder_image": strPtr(defaultBuilderContainer),
"target_name": strPtr("indra"),
"target_build_script": strPtr("docker/build/targets/indra.sh"),
},
SuppressOutput: false,
Remove: true,
ForceRemove: true,
PullParent: false,
},
},
}

View File

@@ -2,6 +2,7 @@ package main
import (
"git-indra.lan/indra-labs/indra/pkg/docker"
"github.com/docker/docker/api/types"
)
var (
@@ -69,24 +70,24 @@ var packagingConfigurations = []docker.BuildConfiguration{
// PullParent: false,
// },
//},
//docker.BuildConfiguration{
// Name: defaultRepositoryName + "/" + "indra-package",
// ContextFilePath: "/tmp/indra-package.tar",
// BuildOpts: types.ImageBuildOptions{
// Dockerfile: "docker/build/package.Dockerfile",
// Tags: []string{
// "dev",
// },
// BuildArgs: map[string]*string{
// "binaries_image": strPtr("indralabs/indra-build"),
// "binaries_version": strPtr("dev"),
// "packaging_image": strPtr(defaultPackagingContainer),
// "target_name": strPtr("indra"),
// },
// SuppressOutput: false,
// Remove: true,
// ForceRemove: true,
// PullParent: false,
// },
//},
docker.BuildConfiguration{
Name: defaultRepositoryName + "/" + "indra-package",
ContextFilePath: "/tmp/indra-package.tar",
BuildOpts: types.ImageBuildOptions{
Dockerfile: "docker/build/package.Dockerfile",
Tags: []string{
"dev",
},
BuildArgs: map[string]*string{
"binaries_image": strPtr("indralabs/indra-build"),
"binaries_version": strPtr("dev"),
"packaging_image": strPtr(defaultPackagingContainer),
"target_name": strPtr("indra"),
},
SuppressOutput: false,
Remove: true,
ForceRemove: true,
PullParent: false,
},
},
}

View File

@@ -1,6 +1,9 @@
package main
import "git-indra.lan/indra-labs/indra/pkg/docker"
import (
"git-indra.lan/indra-labs/indra/pkg/docker"
"github.com/docker/docker/api/types"
)
var sourceConfigurations = []docker.BuildConfiguration{
//docker.BuildConfiguration{
@@ -60,23 +63,23 @@ var sourceConfigurations = []docker.BuildConfiguration{
// PullParent: false,
// },
//},
//docker.BuildConfiguration{
// Name: defaultRepositoryName + "/" + "indra-source",
// ContextFilePath: "/tmp/indra-source-local.tar",
// BuildOpts: types.ImageBuildOptions{
// Dockerfile: "docker/sources/indra/local.Dockerfile",
// Tags: []string{
// "dev",
// },
// BuildArgs: map[string]*string{
// "sourcing_image": strPtr(defaultBuilderContainer),
// },
// SuppressOutput: false,
// Remove: true,
// ForceRemove: true,
// PullParent: false,
// },
//},
docker.BuildConfiguration{
Name: defaultRepositoryName + "/" + "indra-source",
ContextFilePath: "/tmp/indra-source-local.tar",
BuildOpts: types.ImageBuildOptions{
Dockerfile: "docker/sources/indra/local.Dockerfile",
Tags: []string{
"dev",
},
BuildArgs: map[string]*string{
"sourcing_image": strPtr(defaultBuilderContainer),
},
SuppressOutput: false,
Remove: true,
ForceRemove: true,
PullParent: false,
},
},
//docker.BuildConfiguration{
// Name: defaultRepositoryName + "/" + "indra-source",
// ContextFilePath: "/tmp/indra-source.tar",

View File

@@ -23,7 +23,7 @@ RUN set -ex "cleaning up repository" \
WORKDIR /tmp/indra-source
RUN set -ex echo "downloading modules" \
&& go mod vendor
&& GOINSECURE=git-indra.lan/* GOPRIVATE=git-indra.lan/* go mod vendor
FROM scratch

1
go.sum
View File

@@ -155,7 +155,6 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOF
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/btcwallet v0.16.5 h1:4DTJ5aYAJomcR0jAb6JP8D0wNSxfz4H7WN/RBtNZY4o=
github.com/btcsuite/btcwallet v0.16.5/go.mod h1:mM19pFB3lGVxOL+kvHhHZAhdSWXKsZGiHvpJVvxL0D8=

View File

@@ -143,7 +143,7 @@ func AddHandler(handler func()) {
// all other callbacks and exits if not already done.
_, loc, line, _ := runtime.Caller(1)
msg := fmt.Sprintf("%s:%d", loc, line)
log.T.Ln("\n"+strings.Split(msg, indra.PathBase)[1],
log.T.Ln("\n"+strings.Split(msg, indra.PathBase)[0],
"added interrupt handler")
if ch == nil {
ch = make(chan os.Signal)

View File

@@ -83,5 +83,7 @@ func Shutdown() {
isRunning = false
inUse.Unlock()
log.I.Ln("- rpc server shutdown completed")
}

View File

@@ -3,7 +3,10 @@ package seed
import (
"context"
"git-indra.lan/indra-labs/indra/pkg/p2p"
"git-indra.lan/indra-labs/indra/pkg/rpc"
"git-indra.lan/indra-labs/indra/pkg/storage"
"github.com/tutorialedge/go-grpc-tutorial/chat"
"google.golang.org/grpc"
"sync"
)
@@ -64,6 +67,22 @@ func Run(ctx context.Context) {
// Ready!
//
go rpc.RunWith(func(srv *grpc.Server) {
chat.RegisterChatServiceServer(srv, &chat.Server{})
})
select {
case err := <-rpc.WhenStartFailed():
log.E.Ln("rpc can't start:", err)
startupErrors <- err
return
case <-rpc.IsReady():
// continue
case <-ctx.Done():
Shutdown()
return
}
log.I.Ln("seed is ready")
isReadyChan <- true