Commit 2683f98a authored by Raoul Hidalgo Charman's avatar Raoul Hidalgo Charman

_cas: Rename artifactcache folder and move that to a root module

Other components will start to reply on cas modules, and not the artifact cache
modules so it should be organized to reflect this.

All relevant imports have been changed.

Part #802
parent d6587aa0
......@@ -23,14 +23,14 @@ import signal
import string
from collections.abc import Mapping
from ..types import _KeyStrength
from .._exceptions import ArtifactError, CASError, LoadError, LoadErrorReason
from .._message import Message, MessageType
from .. import _signals
from .. import utils
from .. import _yaml
from .cascache import CASRemote, CASRemoteSpec
from .types import _KeyStrength
from ._exceptions import ArtifactError, CASError, LoadError, LoadErrorReason
from ._message import Message, MessageType
from . import _signals
from . import utils
from . import _yaml
from ._cas import CASRemote, CASRemoteSpec
CACHE_SIZE_FILE = "cache_size"
......
......@@ -17,4 +17,4 @@
# Authors:
# Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
from .artifactcache import ArtifactCache, ArtifactCacheSpec, CACHE_SIZE_FILE
from .cascache import CASCache, CASRemote, CASRemoteSpec
......@@ -31,7 +31,7 @@ from ._exceptions import LoadError, LoadErrorReason, BstError
from ._message import Message, MessageType
from ._profile import Topics, profile_start, profile_end
from ._artifactcache import ArtifactCache
from ._artifactcache.cascache import CASCache
from ._cas import CASCache
from ._workspaces import Workspaces, WorkspaceProjectCache, WORKSPACE_PROJECT_FILE
from .plugin import _plugin_lookup
from .sandbox import SandboxRemote
......
......@@ -38,7 +38,7 @@ from .._protos.google.rpc import code_pb2
from .._exceptions import SandboxError
from .. import _yaml
from .._protos.google.longrunning import operations_pb2, operations_pb2_grpc
from .._artifactcache.cascache import CASRemote, CASRemoteSpec
from .._cas import CASRemote, CASRemoteSpec
class RemoteExecutionSpec(namedtuple('RemoteExecutionSpec', 'exec_service storage_service action_service')):
......
......@@ -94,7 +94,7 @@ requiring BuildStream's more exigent dependencies by setting the
Command reference
~~~~~~~~~~~~~~~~~
.. click:: buildstream._artifactcache.casserver:server_main
.. click:: buildstream._cas.casserver:server_main
:prog: bst-artifact-server
......
......@@ -3,8 +3,7 @@ import pytest
import itertools
import os
from buildstream._artifactcache import ArtifactCacheSpec
from buildstream._artifactcache.artifactcache import _configured_remote_artifact_cache_specs
from buildstream._artifactcache import ArtifactCacheSpec, _configured_remote_artifact_cache_specs
from buildstream._context import Context
from buildstream._project import Project
from buildstream.utils import _deduplicate
......
......@@ -342,13 +342,13 @@ def test_invalid_cache_quota(cli, datafiles, tmpdir, quota, success):
total_space = 10000
volume_space_patch = mock.patch(
"buildstream._artifactcache.artifactcache.ArtifactCache._get_volume_space_info_for",
"buildstream._artifactcache.ArtifactCache._get_volume_space_info_for",
autospec=True,
return_value=(free_space, total_space),
)
cache_size_patch = mock.patch(
"buildstream._artifactcache.artifactcache.ArtifactCache.get_cache_size",
"buildstream._artifactcache.ArtifactCache.get_cache_size",
autospec=True,
return_value=0,
)
......
......@@ -3,7 +3,7 @@ import pytest
from buildstream._exceptions import ErrorDomain
from buildstream._artifactcache.cascache import CASCache
from buildstream._cas import CASCache
from buildstream.storage._casbaseddirectory import CasBasedDirectory
from buildstream.storage._filebaseddirectory import FileBasedDirectory
......
......@@ -8,7 +8,7 @@ from tests.testutils import cli
from buildstream.storage._casbaseddirectory import CasBasedDirectory
from buildstream.storage._filebaseddirectory import FileBasedDirectory
from buildstream._artifactcache import ArtifactCache
from buildstream._artifactcache.cascache import CASCache
from buildstream._cas import CASCache
from buildstream import utils
......
......@@ -11,8 +11,8 @@ from multiprocessing import Process, Queue
import pytest_cov
from buildstream import _yaml
from buildstream._artifactcache.cascache import CASCache
from buildstream._artifactcache.casserver import create_server
from buildstream._cas import CASCache
from buildstream._cas.casserver import create_server
from buildstream._exceptions import CASError
from buildstream._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
......
......@@ -23,7 +23,7 @@ def test_parse_size_over_1024T(cli, tmpdir):
_yaml.dump({'name': 'main'}, str(project.join("project.conf")))
volume_space_patch = mock.patch(
"buildstream._artifactcache.artifactcache.ArtifactCache._get_volume_space_info_for",
"buildstream._artifactcache.ArtifactCache._get_volume_space_info_for",
autospec=True,
return_value=(1025 * TiB, 1025 * TiB)
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment