Skip to content

Commit 7b6ca63

Browse files
committed
promoting comment to part of readme
1 parent 65e6f48 commit 7b6ca63

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,32 @@ Also, if Qiita is running with the default server SSL certificate, you need to e
1616

1717
export QIITA_ROOT_CA=<QIITA_INSTALL_PATH>/qiita_core/support_files/ci_rootca.crt
1818
```
19+
20+
Configure for cloud computing
21+
-----------------------------
22+
In the default scenario, Qiita main and Qiita plugins are executed on the same
23+
machines, maybe spread across a Slurm or other grid compute cluster, but main
24+
and plugins have direct access to all files in `BASE_DATA_DIR`.
25+
26+
This can be different, if you set up Qiita within a cloud compute environment,
27+
where main and plugins do **not** share one file system. In this case, input-
28+
files must first be transferred from main to plugin, then plugin can do its
29+
processing and resulting files must be transferred back to main, once
30+
processing is finished. To achieve this, the qiita_client, as it is part of
31+
each plugin, provides the two functions for this file transfer
32+
`fetch_file_from_central` and `push_file_to_central`. According to
33+
`self._plugincoupling`, these functions operate on different "protocols";
34+
as of 2025-08-29, either "filesystem" or "https". Switch to **"https"** for
35+
cloud environments, default is **filesystem**.
36+
37+
The plugin coupling protocoll can be set in three ways
38+
39+
1. default is always "filesystem", i.e. _DEFAULT_PLUGIN_COUPLINGS
40+
This is to be downward compatible.
41+
2. the plugin configuration can hold a section 'network' with an
42+
option 'PLUGINCOUPLING'. For old config files, this might not
43+
(yet) be the case. Therefore, we are double checking existance
44+
of this section and parameter here.
45+
3. you can set the environment variable QIITA_PLUGINCOUPLING
46+
Precedence is 3, 2, 1, i.e. the environment variable overrides the
47+
other two ways.

qiita_client/plugin.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,6 @@ def __call__(self, server_url, job_id, output_dir):
282282
with open(self.conf_fp, 'U') as conf_file:
283283
config.readfp(conf_file)
284284

285-
# the plugin coupling protocoll can be set in three ways
286-
# 1. default is always "filesystem", i.e. _DEFAULT_PLUGIN_COUPLINGS
287-
# This is to be downward compatible.
288-
# 2. the plugin configuration can hold a section 'network' with an
289-
# option 'PLUGINCOUPLING'. For old config files, this might not
290-
# (yet) be the case. Therefore, we are double checking existance
291-
# of this section and parameter here.
292-
# 3. you can set the environment variable QIITA_PLUGINCOUPLING
293-
# Precedence is 3, 2, 1, i.e. the environment variable overrides the
294-
# other two ways.
295285
plugincoupling = self._DEFAULT_PLUGIN_COUPLINGS
296286
if config.has_section('network') and \
297287
config.has_option('network', 'PLUGINCOUPLING'):

qiita_client/qiita_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ def fetch_file_from_central(self, filepath, prefix=None):
773773
str : the filepath of the requested file within the local file system
774774
"""
775775
target_filepath = filepath
776-
if (prefix is not None) and (prefix != ""):
776+
if not prefix:
777777
# strip off root
778778
if filepath.startswith(os.path.abspath(os.sep)):
779779
target_filepath = target_filepath[
@@ -782,7 +782,7 @@ def fetch_file_from_central(self, filepath, prefix=None):
782782
target_filepath = os.path.join(prefix, target_filepath)
783783

784784
if self._plugincoupling == 'filesystem':
785-
if prefix != '':
785+
if not prefix:
786786
# create necessary directory locally
787787
os.makedirs(os.path.dirname(target_filepath), exist_ok=True)
788788

0 commit comments

Comments
 (0)