Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: build cluster image with buildah #1611

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
branches: "*"
paths-ignore:
- 'docs/**'
- 'vendor/**'
- '*.md'
- '*.yml'
jobs:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: '1.16'

- name: Install deps
run: |
sudo apt-get install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
- name: Set env
shell: bash
env:
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ Here are some dependents with specific version:

* golang : v1.14
* golangci-lint: 1.39.0
* gpgme(brew install gpgme)

When you develop the Sealer project at the local environment, you should use subcommands of Makefile to help yourself to check and build the latest version of Sealer. For the convenience of developers, we use the docker to build Sealer. It can reduce problems of the developing environment.

Expand Down
29 changes: 10 additions & 19 deletions apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"github.com/sealerio/sealer/apply/driver"
"github.com/sealerio/sealer/common"
"github.com/sealerio/sealer/pkg/clusterfile"
"github.com/sealerio/sealer/pkg/define/options"
"github.com/sealerio/sealer/pkg/filesystem"
"github.com/sealerio/sealer/pkg/image"
"github.com/sealerio/sealer/pkg/image/store"
"github.com/sealerio/sealer/pkg/imageengine"
v2 "github.com/sealerio/sealer/types/api/v2"
)

Expand Down Expand Up @@ -57,24 +57,22 @@ func NewApplierFromFile(path string) (driver.Interface, error) {
}
path = filepath.Join(pa, path)
}

Clusterfile, err := clusterfile.NewClusterFile(path)
if err != nil {
return nil, err
}
imgSvc, err := image.NewImageService()
if err != nil {
return nil, err
}

mounter, err := filesystem.NewClusterImageMounter()
imageEngine, err := imageengine.NewImageEngine(options.EngineGlobalConfigurations{})
if err != nil {
return nil, err
}

is, err := store.NewDefaultImageStore()
mounter, err := filesystem.NewClusterImageMounter(imageEngine)
if err != nil {
return nil, err
}

cluster := Clusterfile.GetCluster()
if cluster.Name == "" {
return nil, fmt.Errorf("cluster name cannot be empty, make sure %s file is correct", path)
Expand All @@ -85,9 +83,8 @@ func NewApplierFromFile(path string) (driver.Interface, error) {
return &driver.Applier{
ClusterDesired: &cluster,
ClusterFile: Clusterfile,
ImageManager: imgSvc,
ImageEngine: imageEngine,
ClusterImageMounter: mounter,
ImageStore: is,
}, nil
}

Expand All @@ -102,25 +99,19 @@ func NewDefaultApplier(cluster *v2.Cluster) (driver.Interface, error) {
if cluster.Name == "" {
return nil, fmt.Errorf("cluster name cannot be empty")
}
imgSvc, err := image.NewImageService()
if err != nil {
return nil, err
}

mounter, err := filesystem.NewClusterImageMounter()
imageEngine, err := imageengine.NewImageEngine(options.EngineGlobalConfigurations{})
if err != nil {
return nil, err
}

is, err := store.NewDefaultImageStore()
mounter, err := filesystem.NewClusterImageMounter(imageEngine)
if err != nil {
return nil, err
}

return &driver.Applier{
ClusterDesired: cluster,
ImageManager: imgSvc,
ImageEngine: imageEngine,
ClusterImageMounter: mounter,
ImageStore: is,
}, nil
}
Loading