-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8729 from OpenMined/yash/swfs-svc-acc
Add service account to seaweedfs + fixes
- Loading branch information
Showing
7 changed files
with
82 additions
and
54 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/grid/helm/syft/templates/seaweedfs/seaweedfs-service-account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: seaweedfs-service-account | ||
labels: | ||
{{- include "common.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: seaweedfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# stdlib | ||
import logging | ||
import logging.config | ||
from pathlib import Path | ||
import subprocess | ||
|
||
# third party | ||
import yaml | ||
|
||
# relative | ||
from .mount import mount_bucket | ||
from .mount_options import MountOptions | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def automount(automount_conf: Path, mount_conf_dir: Path) -> None: | ||
with automount_conf.open() as f: | ||
config = yaml.safe_load(f) | ||
|
||
mounts = config.get("mounts", []) | ||
for mount_opts in mounts: | ||
mount_opts = MountOptions(**mount_opts) | ||
try: | ||
logger.info( | ||
f"Auto mount type={mount_opts.remote_bucket.type} " | ||
f"bucket={mount_opts.remote_bucket.bucket_name}" | ||
) | ||
result = mount_bucket( | ||
mount_opts, | ||
conf_dir=mount_conf_dir, | ||
overwrite=True, | ||
) | ||
logger.info(f"Auto mount success. {result}") | ||
except FileExistsError as e: | ||
logger.info(e) | ||
except subprocess.CalledProcessError as e: | ||
logger.error( | ||
f"Mount error: code={e.returncode} stdout={e.stdout} stderr={e.stderr}" | ||
) | ||
except Exception as e: | ||
logger.error(f"Unhandled exception: {e}") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters