Skip to content

Commit 0be64d1

Browse files
authored
Merge pull request #313 from WaberZhuang/main
[bugfix] convertor: turbo error when vsize != 64
2 parents 0c2f057 + 62ab766 commit 0be64d1

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

.github/workflows/check.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,14 @@ jobs:
5151
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
5252
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
5353
54-
# TODO(fuweid): remove the env GO111MODULE=off in new version of go
5554
- name: install dependencies
5655
shell: bash
5756
env:
58-
GO111MODULE: off
57+
GO111MODULE: on
5958
run: |
6059
echo "::group:: install dependencies"
61-
go get -u -v github.com/vbatts/git-validation
62-
go get -u -v github.com/kunalkushwaha/ltag
60+
go install -v github.com/vbatts/git-validation@latest
61+
go install -v github.com/kunalkushwaha/ltag@latest
6362
echo "::endgroup::"
6463
6564
- name: DCO checker

.github/workflows/ci-userspace-convertor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ jobs:
7070
/opt/overlaybd/snapshotter/convertor -r localhost:5000/redis -i 7.2.3 --overlaybd 7.2.3_overlaybd --turboOCI 7.2.3_turbo
7171
bash run_container.sh localhost:5000/redis:7.2.3_overlaybd
7272
bash run_container.sh localhost:5000/redis:7.2.3_turbo
73+
/opt/overlaybd/snapshotter/convertor -r localhost:5000/redis -i 7.2.3 --overlaybd 7.2.3_overlaybd_256 --turboOCI 7.2.3_turbo_256 --vsize 256
74+
bash run_container.sh localhost:5000/redis:7.2.3_overlaybd_256
75+
bash run_container.sh localhost:5000/redis:7.2.3_turbo_256
7376
7477
- name: CI - uconv E2E with digest input
7578
working-directory: ci/scripts

ci/scripts/run_container.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
# rpull and run on-demand
44

5+
set -x
6+
57
image=$1
68
container_name=${2:-test}
79

@@ -11,6 +13,7 @@ exit_code=0
1113
if ! ctr run -d --net-host --snapshotter=overlaybd "${image}" "${container_name}"; then
1214
exit_code=1
1315
fi
16+
lsblk
1417
if ! ctr t ls | grep "${container_name}"; then
1518
exit_code=1
1619
fi

cmd/convertor/builder/turboOCI_builder.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (e *turboOCIBuilderEngine) DownloadLayer(ctx context.Context, idx int) erro
8989

9090
func (e *turboOCIBuilderEngine) BuildLayer(ctx context.Context, idx int) error {
9191
layerDir := e.getLayerDir(idx)
92-
if err := e.create(ctx, layerDir, e.mkfs && (idx == 0)); err != nil {
92+
if err := e.create(ctx, idx); err != nil {
9393
return err
9494
}
9595
e.overlaybdConfig.Upper = sn.OverlayBDBSConfigUpper{
@@ -261,17 +261,20 @@ func (e *turboOCIBuilderEngine) createIdentifier(idx int) error {
261261
return nil
262262
}
263263

264-
func (e *turboOCIBuilderEngine) create(ctx context.Context, dir string, mkfs bool) error {
265-
vsizeGB := 64
266-
if mkfs {
264+
func (e *turboOCIBuilderEngine) create(ctx context.Context, idx int) error {
265+
vsizeGB := 64 // use default baselayer
266+
if e.mkfs {
267267
vsizeGB = e.vsize
268268
}
269269
opts := []string{"-s", fmt.Sprintf("%d", vsizeGB), "--turboOCI"}
270-
if mkfs && e.fstype != "erofs" {
271-
opts = append(opts, "--mkfs")
270+
271+
if e.mkfs && idx == 0 {
272272
logrus.Infof("mkfs for baselayer, vsize: %d GB", vsizeGB)
273+
if e.fstype != "erofs" {
274+
opts = append(opts, "--mkfs")
275+
}
273276
}
274-
return utils.Create(ctx, dir, opts...)
277+
return utils.Create(ctx, e.getLayerDir(idx), opts...)
275278
}
276279

277280
func (e *turboOCIBuilderEngine) apply(ctx context.Context, dir string) error {

0 commit comments

Comments
 (0)