Skip to content

feat(dirctl): embed zot into daemon subcommand#1422

Open
arpad-csepi wants to merge 6 commits intomainfrom
feat/embed-zot-to-daemon
Open

feat(dirctl): embed zot into daemon subcommand#1422
arpad-csepi wants to merge 6 commits intomainfrom
feat/embed-zot-to-daemon

Conversation

@arpad-csepi
Copy link
Copy Markdown
Member

@arpad-csepi arpad-csepi commented Apr 27, 2026

This PR removes the local OCI implementation backed by ORAS and adds an optional embedded Zot registry to the dir daemon flow, configured under daemon.zot. When enabled, the daemon starts Zot as an daemon process and points the apiserver OCI store at that registry.

The changes also add unit test and README.md for documentation.

The k8s.io go packages required to be downgraded because zot go package has older version than latest.

These changes enables to provide sync operation and federation in local development environments which detailed here: #1353

Resolves: #1352

@arpad-csepi arpad-csepi added this to the DIR v1.3 milestone Apr 27, 2026
@arpad-csepi arpad-csepi self-assigned this Apr 27, 2026
@arpad-csepi arpad-csepi requested a review from a team as a code owner April 27, 2026 17:06
@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Apr 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedApr 28, 2026, 12:23 PM

@arpad-csepi arpad-csepi force-pushed the feat/embed-zot-to-daemon branch from d5ed61a to c494e52 Compare April 28, 2026 07:54
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
@arpad-csepi arpad-csepi force-pushed the feat/embed-zot-to-daemon branch 3 times, most recently from 27489c7 to 17ce781 Compare April 28, 2026 08:11
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
@arpad-csepi arpad-csepi force-pushed the feat/embed-zot-to-daemon branch 5 times, most recently from c51efbe to 1072454 Compare April 28, 2026 11:28
Comment thread cli/cmd/daemon/config.go
Comment on lines +58 to +80
// DaemonSubConfig holds configuration for the daemon subcomponents.
type DaemonSubConfig struct {
Zot ZotConfig `json:"zot" mapstructure:"zot"`
}

// ZotConfig holds configuration for the embedded Zot registry.
type ZotConfig struct {
Enabled bool `json:"enabled" mapstructure:"enabled"`
Address string `json:"address" mapstructure:"address"`
Port int `json:"port" mapstructure:"port"`
RepositoryName string `json:"repository_name" mapstructure:"repository_name"`
RootDirectory string `json:"root_directory" mapstructure:"root_directory"`
LogLevel string `json:"log_level" mapstructure:"log_level"`
}

func registerDaemonDefaults(v *viper.Viper) {
v.SetDefault("daemon.zot.enabled", false)
v.SetDefault("daemon.zot.address", DefaultZotAddress)
v.SetDefault("daemon.zot.port", DefaultZotPort)
v.SetDefault("daemon.zot.repository_name", DefaultZotRepositoryName)
v.SetDefault("daemon.zot.root_directory", DefaultZotRootDirectory)
v.SetDefault("daemon.zot.log_level", DefaultZotLogLevel)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i would reconsider the way we configure the zot/oci registry here. my suggestion is to do the following:

  • Server storage config can either be a) local dir or b) remote registry
  • For local-dir storage, do the following:
    • the folder is used as a backing store
    • ZOT in-proccess is started at a random port
    • there is no mention of zot

Example configs

Remote registry

store:
    provider: "oci"
    oci:
		# uses remote-OCI registry

Local registry

store:
	provider: "local"
	data_dir: "./dir/to/data" # where the data will be backed
	registry_address: "localhost:5000" # what the OCI storage endpoint will be (in-process ZOT)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As the in-process Zot is integrated to dirctl not the apiserver I think we should not pollute the server store config with options what are not used by the server itself (like data_dir). So how I see it is that the server config describe where to connect, daemon config is to where to serve.

With this daemon section approach (which only applies to the daemon config), the user can set up any daemon related option without using server config later as well if we want to expand.

Also might be better to restructure the daemon config to include the apiserver as a subsection, so we can include the server config as is.

Daemon config

apiserver:
  store:
    provider: "oci"
    ...

daemon:
  zot:
    ...

WDYT? Should we create a unique config for the daemon or still want to include all options to the server config?

Copy link
Copy Markdown
Member Author

@arpad-csepi arpad-csepi Apr 28, 2026

Choose a reason for hiding this comment

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

If we add the option to the user to set where to serve the local zot then they can know all info how use it with apiserver and/or integrate with other stuff.
If we add the option to set where to listen and random pick a port then the user has no idea where to find the local zot and has the possibility for that port is already in-use.

@arpad-csepi arpad-csepi force-pushed the feat/embed-zot-to-daemon branch 4 times, most recently from 3f5e00f to 573ee37 Compare April 28, 2026 12:20
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
@arpad-csepi arpad-csepi force-pushed the feat/embed-zot-to-daemon branch from 573ee37 to c6d99c4 Compare April 28, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Implement embedded Zot integration in daemon startup

2 participants