Skip to content

Conversation

@webern
Copy link
Contributor

@webern webern commented May 29, 2024

Issue number:

Related #209 #210

Description of changes:

For now, twoliter build variant is using the Alpha SDK, which has always had a flat RPM directory structure. Now the build produces a per-package directory structure in build/rpms.

When creating an Alpha SDK we will flatten the RPM directory structure so that twoliter build variant keeps working.

Testing done:

Did this

wrk="$(mktemp -d)"
echo $wrk
cd $wrk

mkdir -p \
  build/rpms/a \
  build/rpms/b \
  build/rpms/c \
  .cargo/sbkeys \
  sources/logdog/conf \
  sources/models/src/variant

touch build/rpms/a/a.rpm \
  build/rpms/b.rpm \
  build/rpms/c1.rpm \
  build/rpms/flat1.rpm \
  build/rpms/c/c1.rpm \
  build/rpms/c/c2.rpm \
  build/rpms/c/c3.rpm \
  .cargo/sbkeys/generate-local-sbkeys \
  .cargo/sbkeys/generate-aws-sbkeys \
  sources/logdog/conf/current \
  sources/models/src/variant \
  touch LICENSE-APACHE \
  touch LICENSE-MIT \
  touch COPYRIGHT

tree -a

docker build \
  --file $REPOS/twoliter/local/alpha-sdk.Dockerfile \
  --build-arg SDK=ubuntu \
  --build-arg HOST_GOARCH=amd64 \
  --tag alpha-sdk-proto:latest \
 .

docker run -it --rm --name deleteme alpha-sdk-proto:latest \
  bash -c 'apt update && apt install tree && tree /twoliter'

Before this change:

/twoliter
`-- alpha
    |-- build
    |   `-- rpms
    |       |-- a
    |       |   `-- a.rpm
    |       |-- b
    |       |-- b.rpm
    |       |-- c
    |       |   |-- c1.rpm
    |       |   |-- c2.rpm
    |       |   `-- c3.rpm
    |       |-- c1.rpm
    |       `-- flat1.rpm
    |-- licenses
    |   |-- COPYRIGHT
    |   |-- LICENSE-APACHE
    |   `-- LICENSE-MIT
    |-- sbkeys
    |   |-- generate-aws-sbkeys
    |   `-- generate-local-sbkeys
    `-- sources
        |-- logdog
        |   `-- conf
        |       `-- current
        `-- models
            `-- src
                `-- variant

After this change

/twoliter
`-- alpha
    |-- build
    |   `-- rpms
    |       |-- a.rpm
    |       |-- b.rpm
    |       |-- c1.rpm
    |       |-- c2.rpm
    |       |-- c3.rpm
    |       `-- flat1.rpm
    |-- licenses
    |   |-- COPYRIGHT
    |   |-- LICENSE-APACHE
    |   `-- LICENSE-MIT
    |-- sbkeys
    |   |-- generate-aws-sbkeys
    |   `-- generate-local-sbkeys
    `-- sources
        |-- logdog
        |   `-- conf
        |       `-- current
        `-- models
            `-- src
                `-- variant

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@webern webern requested review from bcressey and jmt-lab May 29, 2024 20:24
Copy link
Contributor

@sumukhballal sumukhballal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@bcressey bcressey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To support both old and new style build/rpms output:

Copy link
Contributor

@bcressey bcressey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if my suggestion is helpful, if we know the build directory will always start from a clean state for this.

For now, twoliter build variant is using the Alpha SDK, which has always
had a flat RPM directory structure. Now the build produces a per-package
directory structure in build/rpms.

When creating an Alpha SDK we will flatten the RPM directory structure
so that twoliter build variant keeps working.
@webern webern force-pushed the keep-alpha-sdk-flat branch from 39de3a3 to c92363d Compare May 31, 2024 18:25
@webern
Copy link
Contributor Author

webern commented May 31, 2024

https://github.com/bottlerocket-os/twoliter/compare/39de3a3a43715f832e986f18d622b6751030ba0c..c92363d728c7e2f08a3946a61928520a328682f0

Updated with Ben's change and updated the mock/test scenario to make sure it works (it does).

@webern webern merged commit 564c6e4 into bottlerocket-os:develop May 31, 2024
@webern webern deleted the keep-alpha-sdk-flat branch May 31, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants