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

feat: rclone csi support #1707

Merged
merged 22 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ jobs:
renku-gateway: ${{ steps.deploy-comment.outputs.renku-gateway}}
renku-graph: ${{ steps.deploy-comment.outputs.renku-graph}}
renku-ui: ${{ steps.deploy-comment.outputs.renku-ui}}
amalthea: ${{ steps.deploy-comment.outputs.amalthea}}
renku-data-services: ${{ steps.deploy-comment.outputs.renku-data-services}}
test-enabled: ${{ steps.deploy-comment.outputs.test-enabled}}
extra-values: ${{ steps.deploy-comment.outputs.extra-values}}
steps:
- id: deploy-comment
uses: SwissDataScienceCenter/renku-actions/check-pr-description@v1.8.5
uses: SwissDataScienceCenter/renku-actions/check-pr-description@amalthea-deploy
with:
string: /deploy
pr_ref: ${{ github.event.number }}
Expand All @@ -42,7 +43,7 @@ jobs:
url: https://renku-ci-nb-${{ github.event.number }}.dev.renku.ch
steps:
- name: deploy-pr
uses: SwissDataScienceCenter/renku-actions/deploy-renku@v1.8.5
uses: SwissDataScienceCenter/renku-actions/deploy-renku@amalthea-deploy
env:
DOCKER_PASSWORD: ${{ secrets.RENKU_DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.RENKU_DOCKER_USERNAME }}
Expand All @@ -65,6 +66,7 @@ jobs:
renku_gateway: "${{ needs.check-deploy.outputs.renku-gateway }}"
renku_data_services: "${{ needs.check-deploy.outputs.renku-data-services }}"
renku_ui: "${{ needs.check-deploy.outputs.renku-ui }}"
amalthea: "${{ needs.check-deploy.outputs.amalthea }}"
extra_values: "${{ needs.check-deploy.outputs.extra-values }}"
- name: Check existing renkubot comment
uses: peter-evans/find-comment@v2
Expand All @@ -87,7 +89,7 @@ jobs:
if: github.event.action != 'closed' && needs.check-deploy.outputs.pr-contains-string == 'true' && needs.check-deploy.outputs.test-enabled == 'true'
runs-on: ubuntu-22.04
steps:
- uses: SwissDataScienceCenter/renku-actions/test-renku@v1.8.5
- uses: SwissDataScienceCenter/renku-actions/test-renku@amalthea-deploy
with:
kubeconfig: ${{ secrets.RENKUBOT_DEV_KUBECONFIG }}
renku-release: renku-ci-nb-${{ github.event.number }}
Expand Down Expand Up @@ -116,7 +118,7 @@ jobs:
steps:
- name: Extract Renku repository reference
run: echo "RENKU_REFERENCE=`echo '${{ needs.check-deploy.outputs.renku }}' | cut -d'@' -f2`" >> $GITHUB_ENV
- uses: SwissDataScienceCenter/renku-actions/test-renku-cypress@v1.8.5
- uses: SwissDataScienceCenter/renku-actions/test-renku-cypress@amalthea-deploy
with:
e2e-target: ${{ matrix.tests }}
renku-reference: ${{ env.RENKU_REFERENCE }}
Expand All @@ -130,7 +132,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: renku teardown
uses: SwissDataScienceCenter/renku-actions/cleanup-renku-ci-deployments@v1.8.5
uses: SwissDataScienceCenter/renku-actions/cleanup-renku-ci-deployments@amalthea-deploy
env:
HELM_RELEASE_REGEX: "^renku-ci-nb-${{ github.event.number }}$"
GITLAB_TOKEN: ${{ secrets.DEV_GITLAB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion git_services/git_services/init/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
git_cloner.run(
session_branch=config.branch,
root_commit_sha=config.commit_sha,
s3_mounts=config.s3_mounts,
storage_mounts=config.storage_mounts,
)
12 changes: 6 additions & 6 deletions git_services/git_services/init/cloner.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def _repo_exists(self):
return False
return res.lower().strip() == "true"

def run(self, *, session_branch: str, root_commit_sha: str, s3_mounts: List[str]):
def run(self, *, session_branch: str, root_commit_sha: str, storage_mounts: List[str]):
logging.info("Checking if the repo already exists.")
if self._repo_exists():
# NOTE: This will run when a session is resumed, removing the repo here
Expand All @@ -186,12 +186,12 @@ def run(self, *, session_branch: str, root_commit_sha: str, s3_mounts: List[str]
else:
with self._temp_plaintext_credentials():
self._clone(session_branch)
# NOTE: If the S3 mount location already exists it means that the repo folder/file
# NOTE: If the storage mount location already exists it means that the repo folder/file
# or another existing file will be overwritten, so raise an error here and crash.
for a_mount in s3_mounts:
for a_mount in storage_mounts:
if Path(a_mount).exists():
raise errors.CloudStorageOverwritesExistingFilesError
self._setup_proxy()
logging.info(f"Excluding cloud storage from git: {s3_mounts}")
if s3_mounts:
self._exclude_storages_from_git(s3_mounts)
logging.info(f"Excluding cloud storage from git: {storage_mounts}")
if storage_mounts:
self._exclude_storages_from_git(storage_mounts)
6 changes: 3 additions & 3 deletions git_services/git_services/init/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import dataconf

from git_services.init import errors
from git_services.cli.sentry import SentryConfig
from git_services.init import errors


@dataclass
Expand Down Expand Up @@ -41,15 +41,15 @@ class Config:
sentry: SentryConfig
lfs_auto_fetch: Union[str, bool] = "0"
mount_path: str = "/work"
s3_mounts: List[str] = field(default_factory=list)
storage_mounts: List[str] = field(default_factory=list)

def __post_init__(self):
allowed_string_flags = ["0", "1"]
if self.lfs_auto_fetch not in allowed_string_flags:
raise ValueError("lfs_auto_fetch can only be a string with values '0' or '1'")
if isinstance(self.lfs_auto_fetch, str):
self.lfs_auto_fetch = self.lfs_auto_fetch == "1"
for mount in self.s3_mounts:
for mount in self.storage_mounts:
if not Path(mount).is_absolute():
raise errors.CloudStorageMountPathNotAbsolute

Expand Down
Loading
Loading