Skip to content

Commit

Permalink
switch to images/pkg/dnfjson and remove internal copy
Browse files Browse the repository at this point in the history
COMPOSER-2068
  • Loading branch information
diaasami committed Feb 16, 2024
1 parent 4f91d8d commit 09478b7
Show file tree
Hide file tree
Showing 23 changed files with 115 additions and 1,153 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
- name: Run unit tests
run: go test -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=$(go list ./... | grep -v rpmmd/test$ | tr "\n" ",") ./...

- name: Run dnfjson tests with force-dnf to make sure it's not skipped for any reason
run: go test -race ./internal/dnfjson/... -force-dnf

- name: Send coverage to codecov.io
run: bash <(curl -s https://codecov.io/bash)

Expand Down
4 changes: 2 additions & 2 deletions Schutzfile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
"rhel-8.9": {
"dependencies": {
"osbuild": {
"commit": "5fc3b565a257b0e0636d9e7f0015fc7f6cae0e55"
"commit": "619a64f0bd7322628ae5fedf8b3a640e42f9edcd"
}
}
},
Expand Down Expand Up @@ -236,7 +236,7 @@
"rhel-9.3": {
"dependencies": {
"osbuild": {
"commit": "5fc3b565a257b0e0636d9e7f0015fc7f6cae0e55"
"commit": "619a64f0bd7322628ae5fedf8b3a640e42f9edcd"
}
}
},
Expand Down
3 changes: 1 addition & 2 deletions cmd/gen-manifests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/osbuild/images/pkg/rhsm/facts"
"github.com/osbuild/images/pkg/rpmmd"

"github.com/osbuild/osbuild-composer/internal/dnfjson"
"github.com/osbuild/images/pkg/dnfjson"
)

type multiValue []string
Expand Down Expand Up @@ -323,7 +323,6 @@ func resolvePipelineCommits(commitSources map[string][]ostree.SourceSpec) map[st

func depsolve(cacheDir string, packageSets map[string][]rpmmd.PackageSet, d distro.Distro, arch string) (map[string][]rpmmd.PackageSpec, error) {
solver := dnfjson.NewSolver(d.ModulePlatformID(), d.Releasever(), arch, d.Name(), cacheDir)
solver.SetDNFJSONPath("./dnf-json")
depsolvedSets := make(map[string][]rpmmd.PackageSpec)
for name, pkgSet := range packageSets {
res, err := solver.Depsolve(pkgSet)
Expand Down
2 changes: 1 addition & 1 deletion cmd/mock-dnf-json/dnf-json.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"os"
"strings"

"github.com/osbuild/osbuild-composer/internal/dnfjson"
"github.com/osbuild/images/pkg/dnfjson"
)

func maybeFail(err error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/osbuild-composer/composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"github.com/osbuild/osbuild-composer/pkg/jobqueue/dbjobqueue"

"github.com/osbuild/images/pkg/distrofactory"
"github.com/osbuild/images/pkg/dnfjson"
"github.com/osbuild/osbuild-composer/internal/auth"
"github.com/osbuild/osbuild-composer/internal/cloudapi"
v2 "github.com/osbuild/osbuild-composer/internal/cloudapi/v2"
"github.com/osbuild/osbuild-composer/internal/dnfjson"
"github.com/osbuild/osbuild-composer/internal/jobqueue/fsjobqueue"
"github.com/osbuild/osbuild-composer/internal/weldr"
"github.com/osbuild/osbuild-composer/internal/worker"
Expand Down
2 changes: 1 addition & 1 deletion cmd/osbuild-composer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func GetDefaultConfig() *ComposerConfigFile {
},
LogLevel: "info",
LogFormat: "text",
DNFJson: "/usr/libexec/osbuild-composer/dnf-json",
DNFJson: "/usr/libexec/osbuild-depsolve-dnf",
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/osbuild-dnf-json-tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"github.com/osbuild/images/pkg/blueprint"
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/distro/rhel9"
"github.com/osbuild/images/pkg/dnfjson"
"github.com/osbuild/images/pkg/ostree"
"github.com/osbuild/images/pkg/reporegistry"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/osbuild-composer/internal/dnfjson"
)

// This test loads all the repositories available in /repositories directory
Expand Down
2 changes: 1 addition & 1 deletion cmd/osbuild-store-dump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"github.com/osbuild/images/pkg/distro"
"github.com/osbuild/images/pkg/distro/fedora"
"github.com/osbuild/images/pkg/distrofactory"
"github.com/osbuild/images/pkg/dnfjson"
"github.com/osbuild/images/pkg/manifest"
"github.com/osbuild/images/pkg/reporegistry"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/dnfjson"
"github.com/osbuild/osbuild-composer/internal/store"
"github.com/osbuild/osbuild-composer/internal/target"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/osbuild-worker/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Test_parseConfig(t *testing.T) {
config: `
# comment
base_path = "/api/image-builder-worker/v1"
dnf-json = "/usr/libexec/dnf-json"
dnf-json = "/usr/libexec/osbuild-depsolve-dnf"
[composer]
proxy = "http://proxy.example.com"
Expand Down Expand Up @@ -72,7 +72,7 @@ server_address = "https://example.com/pulp"
`,
want: &workerConfig{
BasePath: "/api/image-builder-worker/v1",
DNFJson: "/usr/libexec/dnf-json",
DNFJson: "/usr/libexec/osbuild-depsolve-dnf",
OSBuildExecutor: &executorConfig{
Type: "host",
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/osbuild-worker/jobimpl-depsolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/sirupsen/logrus"

"github.com/osbuild/images/pkg/dnfjson"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/osbuild-composer/internal/dnfjson"
"github.com/osbuild/osbuild-composer/internal/worker"
"github.com/osbuild/osbuild-composer/internal/worker/clienterrors"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/osbuild-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/sirupsen/logrus"

"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/osbuild-composer/internal/dnfjson"
"github.com/osbuild/images/pkg/dnfjson"
"github.com/osbuild/osbuild-composer/internal/upload/azure"
"github.com/osbuild/osbuild-composer/internal/upload/koji"
"github.com/osbuild/osbuild-composer/internal/upload/oci"
Expand Down
1 change: 0 additions & 1 deletion distribution/Dockerfile-ubi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ RUN mkdir -p "/usr/share/osbuild-composer/"
RUN mkdir -p "/opt/migrate/"
COPY --from=builder /opt/app-root/src/go/bin/osbuild-composer /usr/libexec/osbuild-composer/
COPY ./containers/osbuild-composer/entrypoint.py /opt/entrypoint.py
COPY ./dnf-json /usr/libexec/osbuild-composer/

COPY ./pkg/jobqueue/dbjobqueue/schemas /opt/migrate/schemas
COPY --from=builder2 /opt/app-root/src/go/bin/tern /opt/migrate/
Expand Down
1 change: 0 additions & 1 deletion distribution/Dockerfile-worker
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ RUN mkdir -p "/var/cache/osbuild-worker/"
RUN mkdir -p "/var/lib/osbuild-composer/"
RUN mkdir -p "/var/cache/osbuild-composer/output"
COPY --from=builder /opt/app-root/src/go/bin/osbuild-worker /usr/libexec/osbuild-composer/
COPY ./dnf-json /usr/libexec/osbuild-composer/

ENTRYPOINT ["/usr/libexec/osbuild-composer/osbuild-worker"]
2 changes: 1 addition & 1 deletion internal/client/unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"testing"

"github.com/osbuild/images/pkg/distro/test_distro"
"github.com/osbuild/images/pkg/dnfjson"
"github.com/osbuild/images/pkg/reporegistry"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/osbuild-composer/internal/dnfjson"
dnfjson_mock "github.com/osbuild/osbuild-composer/internal/mocks/dnfjson"
rpmmd_mock "github.com/osbuild/osbuild-composer/internal/mocks/rpmmd"
"github.com/osbuild/osbuild-composer/internal/weldr"
Expand Down
Loading

0 comments on commit 09478b7

Please sign in to comment.