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

Does offline flag apply to dnf repos? #626

Closed
gtkramer opened this issue Oct 24, 2019 · 6 comments
Closed

Does offline flag apply to dnf repos? #626

gtkramer opened this issue Oct 24, 2019 · 6 comments
Labels

Comments

@gtkramer
Copy link

gtkramer commented Oct 24, 2019

Mixer will supply a default clear repo during initialization. If a user supplies the --offline flag for all mixer commands and also supplies a local file:// repo URL, the upstream repo is still enabled in .yum-mix.conf and dnf will have the option of reaching out to the online repo. Is this the intended behavior?

@reaganlo reaganlo changed the title [question]: Does offline flag apply to dnf repos? Does offline flag apply to dnf repos? Oct 25, 2019
@gtkramer
Copy link
Author

Would be obsoleted with a CLI design similar to #627

@reaganlo
Copy link
Contributor

reaganlo commented Nov 1, 2019

The following DNF commands get executed in offline mode:

1) dnf --config=.yum-mix.conf -y --releasever=31290 --installroot=/tmp/MixerEmptyDirForNoopInstall061038593 --assumeno
2) dnf --config=.yum-mix.conf -y --releasever=31290 repoquery -l --quiet --repo local
3) dnf --config=.yum-mix.conf -y --releasever=31290 clean all
4) dnf --config=.yum-mix.conf -y --releasever=31290 --installroot=update/image/10/full install --downloadonly
5) dnf --config=.yum-mix.conf -y --releasever=31290 --installroot=update/image/10/full install

The last command will become obsolete with the upcoming rpm extraction PR #615
@ashleshaAtrey For the rest of the commands, can we confirm when does DNF refer to the clear repo given our default .yum-mix.conf is:

[clear]
name=Clear
failovermethod=priority
baseurl=https://cdn.download.clearlinux.org/releases/$releasever/clear/x86_64/os/
enabled=1
gpgcheck=0
timeout=45

[local]
name=Local
failovermethod=priority
baseurl=file:///<local-yum>
enabled=1
gpgcheck=0
priority=1

@ashleshaAtrey
Copy link
Contributor

currently any dnf command run in offline mode will go online (if it has access) if it is not able to do it in offline mode. If it doesn't have online access, it will fail only in download step that too after 4 attempts. It doesn't error out in resolving steps. Just prints No match for argument.
@rchiossi is this suppose to be intended behavior?

After merging PR #615, in offline mode it will not go online (even if it has access) in download step and return error. For resolving packages and files, the behavior remains same as before (it will go online and resolve the files).

@reaganlo
Copy link
Contributor

reaganlo commented Nov 9, 2019

@rchiossi Also, any reason why mixer init --offline prompts the user to provide a --clear-version?
Why can't it behave the way mixer init --no-default-bundles --all-local does?

@rchiossi
Copy link
Contributor

The way things are implemented right now, a mix is always expected to be based of something. There are many commands and internal checks that will use the value provided by --clear-version, like mixer versions. Most of those are avoided by upstream by either using the --offline flag or just never using the command that requires that value. Init wants a value that can be used for those cases (it doesn't know that you will be skipping them in the future), so there is no way around it. Without the offline flag, if you don't provide --clear-version, mixer will fetch the latest version, so that is why it works.

It might be nice to consider an Upstream Mode for future implementation, where we are not required to provide an upstream version and we ensure that all commands work properly on that mode. That should make the integration with distro-factory for upstream much cleaner.

@reaganlo
Copy link
Contributor

Conclusion: No, the offline flag does not apply to dnf repos and packages. It only applies to the fetching of bundle definition files.
--offline Skip caching upstream-bundles; work entirely with local-bundles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants