| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Contain cache key logic in Element class.
|
|
|
|
| |
Contain cache key logic in Element class.
|
|
|
|
| |
Contain cache key logic in Element class.
|
|
|
|
| |
Contain cache key logic in Element class.
|
| |
|
|
|
|
| |
Contain cache key logic in Element class.
|
|
|
|
| |
Contain cache key logic in Element class.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds two separate checks to avoid pushing artifacts unnecessarily.
First, in the OSTreeCache.push() method we now first obtain the list of
remotes that contain the refs that we are about to push. We then avoid
pushing to any remote that already contains that ref.
Note that the internal ref map is read once on process startup, so
if multiple `bst` processes are pushing to a cache they might still both
push the same artifact. There is an existing issue for this:
https://gitlab.com/BuildStream/buildstream/issues/179
Secondly the Element._skip_push() method now checks if all remote
caches configured for pushing already have a given artifact, and will
skip the push job altogether if they do. The first check would already
mean that no pushes would actually happen, but without the second check
the user would still see Push jobs being created for every artifact
which would be quite misleading.
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a couple of simple classes in order to reduce the
number of different dictionaries tracking the state of the remotes
within the OSTreeCache object.
It also extends the internal ref map to remember all the remotes that
store a given ref, not just the highest priority ref, and modifies the
remote_contains_key() method to expose that data.
|
| |
|
|
|
|
| |
Boolean positional arguments can be confusing.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Before:
[--:--:--] WARNING Failed to fetch remote refs from ssh://ostree@ostree.baserock.org:22000/cache: BuildStream did not connect successfully to the shared cache ssh://ostree@ostree.baserock.org:22000/cache: SSH error: ssh: connect to host ostree.baserock.org port 22000: Connection refused
After:
[--:--:--] WARNING Failed to fetch remote refs from ssh://ostree@ostree.baserock.org:22000/cache. ssh: connect to host ostree.baserock.org port 22000: Connection refused
|
|
|
|
|
|
|
|
|
|
| |
This adds the _update_state() method to the Element class to keep track
of element state and avoid calculating the same cache key multiple
times. This also consolidates the different get_cache_key
methods into a single method that always returns the cache key
calculated by _update_state(), if available.
Fixes #149, #173
|
| |
|
|
|
|
|
|
|
|
|
| |
We have a policy that subprocesses can return error messages, but not
actual exceptions.
In particular this allows GLib.Error exceptions to be returned, which
would otherwise be silently lost due to
https://gitlab.gnome.org/GNOME/pygobject/issues/145
|
|
|
|
|
| |
This reduces the differences between local and remote artifact
repositories, increasing code coverage of tests.
|
|
|
|
|
| |
Closing stdout will cause an exception when used with multiprocessing as
that calls sys.stdout.flush() as well.
|
|
|
|
|
|
| |
initializing cache
This fixes issue #141
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you have an artifact remote cache in your config using the ssh://
protocol and some SSH issue prevents us from connecting, we now show
the user the stderr output from the `ssh` program, e.g.
[--:--:--] WARNING Failed to fetch remote refs from ssh://artifacts@172.17.0.2:22200/artifacts/: BuildStream did not connect successfully to the shared cache ssh://artifacts@172.17.0.2:22200/artifacts/: Permission denied (publickey,keyboard-interactive).
Previously we would just show the error message raised by the protocol
code, which was less useful, e.g.:
[--:--:--] WARNING Failed to fetch remote refs from ssh://artifacts@172.17.0.2:22200/artifacts/: BuildStream did not connect successfully to the shared cache ssh://artifacts@172.17.0.2:22200/artifacts/: Expected reply, got none
|
|
|
|
|
|
|
|
|
|
| |
The initial multiple cache support patch implemented a rather fragile
logic where we would push to the first cache in the list that used the
ssh:// protocol, if any. If we implement push-over-https:// in future
then this will become totally unworkable.
This patch alters the logic so that each remote has a 'push' option,
and BuildStream will push to any remote that has 'push: true' set.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This extends the 'artifacts' configuration block such that a list of
`url` mappings can be given instead of a single entry. For example:
artifacts:
- url: http://example.com/artifacts1
- url: ssh://ostree@example.com/artifacts2
The OSTreeCache class is updated to set up multiple remotes and query
remote refs from all of them.
There are no automated tests for this yet.
Empty URLs ('') now raise an exception. They cause breakages internally
if we allow them through, and they can only occur if the user or our
tests are misconfiguring things somehow.
We report failure to fetch from the cache by printing a message to
stderr for now. This is because BuildStream's actual logging
functionality can't be used during frontend init -- see issue #168.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a regression from the canonical-pull-urls branch that was
just merged. The `OSTreeCache.__init__()` function was connecting to
the cache, which is bad because execution would randomly freeze for
several seconds when the connection was slow.
We now only initialize remote connections where needed; this was
already introduced in 5c2ef6d076921bc0121e61efaa7a719c34ea1912 but
had regressed. I renamed the keyword arg from `fetch_remote_refs`
to `use_remote_cache` because it needs to be set for any interaction
with the remote cache, doesn't matter if they are fetches or pushes.
The initialization stage is also moved later so that we print a message
telling the user what we are up to before trying the network access.
|
| |
|
|
|
|
|
|
|
|
| |
This is possible now that the SSH protocol can redirect to the
appropriate pull URL.
Note that this commit makes no attempt at backwards compatibility.
Everthing will break!
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ports can and should be specified by using proper ssh:// URL forms,
e.g:
ssh://artifacts@example.com:22200/artifacts
The alternate form of artifacts@example.com:artifacts isn't a valid
URL, and doesn't let you specify a different port. People are used
to this form due to Git continuing to use it but we should encourage
people to use proper URLs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change is part of issue #112 ("Artifact configuration is confusing
and fragile, need canonical push/pull urls.")
It updates the bst-artifact-receive program to send a pull URL to
clients who access it over SSH.
This requires extra configuration in the artifact cache server, so that
it knows the correct pull URL. Versions of BuildStream which contain
this commit will not be able to communicate over SSH with artifact
caches that have not been updated to the same version.
Currently this is just used to double-check user configuration, but we
can now simplify the user facing configuration for artifact caches
completely.
|
| |
|
|
|
|
|
|
|
| |
When reading element.py, I was surprised that it was importing
'inspect'.
Remove that import and some other unused ones to improve readability.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This required adding two new APIs to make up for it on the Source
o get_project_directory()
Added here because elements should not be accessing external
resources, Sources needed for local files and GPG keys and such
o translate_url()
Used by sources to mish-mash the project aliases and create
real urls.
|
|
|
|
| |
This is now part of the already private _exceptions module
|
|
|
|
| |
Hide all of buildstream's internal exceptions from the API surface.
|
|
|
|
|
|
| |
This is used by the platform to disable pushing explicitly in
the case that we're falling back to not using user namespaces, in
which case we dont entirely trust the artifacts we create.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This is merely a protection against crossing the project/context
wires together. The Project will gain knowledge of the context soon,
so it's better that the context itself remain without any knowledge
of the context.
|
|
|
|
|
|
|
|
|
|
| |
All of the _yaml APIs which deal with a node (dictionary loaded
from YAML) are named _yaml.node_foo(), _yaml.node_bar(), _yaml.node_baz()
etc, except for this one glaring exception.
Also added a missing internal API documenting comment for _yaml.node_validate()
Also updated all callers to _yaml.validate_node() to now call _yaml.node_validate().
|
|
|
|
|
|
| |
This was incorrectly accessing the dictionaries directly without
the proper _yaml.node_get() APIs, it was also missing out on
validation of the artifact configuration.
|
|
|
|
|
|
|
|
|
|
| |
Two branches got developed at the same time:
* Tristan's cross-platform work
* my work on per-project overrides for artifacts-related options
Mine got merged first, and somehow this must have been missed in a
rebase.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A project can specify its artifacts cache sharing settings, and users can
define a default artifacts cache to use as a fallback.
With this change, users can also override the project configuration with
their own.
That means for a project named "libfoo", BuildStream will resolve the
artifacts-related options in the following order:
1. the projects.libfoo.artifacts options from the user configuration;
2. if the above was not defined, then the artifacts options from the
project configuration;
3. if the above was not defined, then the artifacts options from the
user configuration;
Fixes #87
|