rda-python-dsarch 2.0.21__tar.gz → 3.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {rda_python_dsarch-2.0.21/src/rda_python_dsarch.egg-info → rda_python_dsarch-3.0.1}/PKG-INFO +78 -23
  2. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/README.md +77 -22
  3. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/pyproject.toml +1 -2
  4. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch/dsarch.py +3 -11
  5. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch/dsarch.usg +8 -0
  6. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1/src/rda_python_dsarch.egg-info}/PKG-INFO +78 -23
  7. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch.egg-info/SOURCES.txt +0 -1
  8. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch.egg-info/entry_points.txt +0 -1
  9. rda_python_dsarch-2.0.21/src/rda_python_dsarch/dsarch_setup.py +0 -69
  10. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/LICENSE +0 -0
  11. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/MANIFEST.in +0 -0
  12. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/setup.cfg +0 -0
  13. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch/PgArch.py +0 -0
  14. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch/PgMeta.py +0 -0
  15. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch/__init__.py +0 -0
  16. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch/ds_arch.py +0 -0
  17. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch/pg_arch.py +0 -0
  18. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch/pg_meta.py +0 -0
  19. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch.egg-info/dependency_links.txt +0 -0
  20. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch.egg-info/requires.txt +0 -0
  21. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/src/rda_python_dsarch.egg-info/top_level.txt +0 -0
  22. {rda_python_dsarch-2.0.21 → rda_python_dsarch-3.0.1}/tests/test_dsarch.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dsarch
3
- Version: 2.0.21
3
+ Version: 3.0.1
4
4
  Summary: RDA Python package for utility program dsarch archive RDA data
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dsarch
@@ -56,39 +56,90 @@ The inheritance chain is `DsArch -> PgArch -> PgMeta -> PgCMD/PgSplit`, so
56
56
  `DsArch` instances expose every option, path, count, and database helper
57
57
  through a single object.
58
58
 
59
- ## Setuid Setup
60
-
61
- `dsarch` is executed as the common user `gdexdata` via the `rda_python_setuid`
62
- setuid mechanism. `rda_python_setuid` is declared as a dependency and is
63
- installed automatically with this package.
59
+ ## Environment setup
64
60
 
65
- ### Environment setup
61
+ Create a Python environment first; package installs in the next section run
62
+ inside whichever environment you activate here.
66
63
 
67
- #### Option A — Python venv (DECS machines)
64
+ ### Option A — Python venv (DECS machines)
68
65
 
69
66
  ```bash
70
67
  python3 -m venv $ENVHOME # e.g. /glade/u/home/gdexdata/gdexmsenv
71
68
  source $ENVHOME/bin/activate
72
- pip install rda_python_dsarch
73
69
  ```
74
70
 
75
- #### Option B — Conda (DAV/Casper)
71
+ ### Option B — Conda (DAV/Casper)
76
72
 
77
73
  ```bash
78
- conda activate pg-gdex # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
79
- pip install rda_python_dsarch
74
+ conda create --prefix $ENVHOME python=3.12 # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
75
+ conda activate $ENVHOME
80
76
  ```
81
77
 
82
- ### Full setuid install (requires sudo access to gdexdata)
78
+ ## Installing rda-python-dsarch
83
79
 
84
- Run these steps once per environment after `pip install`:
80
+ Pick whichever install mode fits your workflow. All four pull in the
81
+ transitive dependencies (`rda_python_common`, `rda_python_setuid`,
82
+ `rda_python_miscs`) automatically.
83
+
84
+ For local development, clone this repo alongside your project and install it
85
+ in editable mode so that changes are picked up without re-installing:
85
86
 
86
87
  ```bash
87
- # Compile the pywrapper C binary (once per environment):
88
- pywrapper-install -c|--compile -u|--user gdexdata
88
+ git clone https://github.com/NCAR/rda-python-dsarch.git
89
+ cd rda-python-dsarch
90
+ pip install -e .
91
+ ```
89
92
 
90
- # Wire up dsarch as a setuid entry:
91
- pywrapper-install -l|--link dsarch -u|--user gdexdata
93
+ To test a specific branch (e.g. an in-progress feature or fix branch), pass
94
+ `-b/--branch` to `git clone`:
95
+
96
+ ```bash
97
+ git clone -b <branch-name> https://github.com/NCAR/rda-python-dsarch.git
98
+ cd rda-python-dsarch
99
+ pip install -e .
100
+ ```
101
+
102
+ For a regular (non-editable) install from a checkout:
103
+
104
+ ```bash
105
+ pip install /path/to/rda-python-dsarch
106
+ ```
107
+
108
+ For a production install on a system that uses the published distribution:
109
+
110
+ ```bash
111
+ pip install rda_python_dsarch
112
+ ```
113
+
114
+ ## Setuid Setup
115
+
116
+ `dsarch` is executed as the common user `PGLOG['COMMONUSER']` (default
117
+ `gdexdata`) via the `rda_python_setuid` setuid mechanism, which is pulled
118
+ in automatically as a dependency. After `pip install` above, choose one
119
+ of the wiring options below.
120
+
121
+ > **Note:** If `rda_python_setuid` is already installed and fully set up in
122
+ > your environment, you can skip the compile step (`-c/--compile`) and the
123
+ > optional `pgstart` step (`-p/--pgstart`). The `-l/--link` step is still
124
+ > required to wire up this package's own setuid program.
125
+
126
+ ### Full setuid install (requires sudo access to COMMONUSER)
127
+
128
+ Run these steps once per environment:
129
+
130
+ ```bash
131
+ # 1. Compile the pywrapper C binary (once per environment):
132
+ pywrapper-install -c|--compile -n|--username gdexdata
133
+
134
+ # 2. Wire up dsarch as a setuid entry (or use 'all' to link every setuid_* at once):
135
+ pywrapper-install -l|--link dsarch
136
+ pywrapper-install -l|--link all
137
+
138
+ # 3. Optionally, install a pgstart_<loginname> binary so <loginname> (any
139
+ # user in the same group as PGLOG['COMMONUSER']) can run commands as
140
+ # themselves. Run either by PGLOG['ADMINUSER'] (default zji, if it has
141
+ # 'sudo -u <loginname>'), or by <loginname> directly:
142
+ pywrapper-install -p|--pgstart -n|--username <loginname>
92
143
  ```
93
144
 
94
145
  `pywrapper-install` with no arguments displays the full user guide.
@@ -99,21 +150,25 @@ Users who do not need the setuid mechanism can create a direct symlink instead:
99
150
 
100
151
  ```bash
101
152
  pywrapper-install -l|--link dsarch -s|--simple
153
+ pywrapper-install -l|--link all -s|--simple # or link every setuid_* at once
102
154
  ```
103
155
 
104
156
  This creates `bin/dsarch -> bin/setuid_dsarch` and the program runs as the
105
157
  current user with no privilege change.
106
158
 
107
- ### Setup guide
159
+ ### Update an existing installation (no sudo required)
108
160
 
109
- After `pip install`, run `dsarch-setup` at any time to display the setup guide:
161
+ When the package is upgraded and a new `pywrapper.c` is bundled, recompile and
162
+ reinstall all setuid binaries using the existing `pgstart_*` binaries:
110
163
 
111
164
  ```bash
112
- dsarch-setup
165
+ pywrapper-install -u|--update
113
166
  ```
114
167
 
115
- The guide is also shown automatically if `setuid_dsarch` is invoked directly
116
- before the setuid wrapper has been configured.
168
+ ### Setup guide
169
+
170
+ The shared setuid setup guide is shown automatically if `setuid_dsarch` is
171
+ invoked directly before the setuid wrapper has been configured.
117
172
 
118
173
  ## Documentation sync
119
174
 
@@ -38,39 +38,90 @@ The inheritance chain is `DsArch -> PgArch -> PgMeta -> PgCMD/PgSplit`, so
38
38
  `DsArch` instances expose every option, path, count, and database helper
39
39
  through a single object.
40
40
 
41
- ## Setuid Setup
42
-
43
- `dsarch` is executed as the common user `gdexdata` via the `rda_python_setuid`
44
- setuid mechanism. `rda_python_setuid` is declared as a dependency and is
45
- installed automatically with this package.
41
+ ## Environment setup
46
42
 
47
- ### Environment setup
43
+ Create a Python environment first; package installs in the next section run
44
+ inside whichever environment you activate here.
48
45
 
49
- #### Option A — Python venv (DECS machines)
46
+ ### Option A — Python venv (DECS machines)
50
47
 
51
48
  ```bash
52
49
  python3 -m venv $ENVHOME # e.g. /glade/u/home/gdexdata/gdexmsenv
53
50
  source $ENVHOME/bin/activate
54
- pip install rda_python_dsarch
55
51
  ```
56
52
 
57
- #### Option B — Conda (DAV/Casper)
53
+ ### Option B — Conda (DAV/Casper)
58
54
 
59
55
  ```bash
60
- conda activate pg-gdex # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
61
- pip install rda_python_dsarch
56
+ conda create --prefix $ENVHOME python=3.12 # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
57
+ conda activate $ENVHOME
62
58
  ```
63
59
 
64
- ### Full setuid install (requires sudo access to gdexdata)
60
+ ## Installing rda-python-dsarch
65
61
 
66
- Run these steps once per environment after `pip install`:
62
+ Pick whichever install mode fits your workflow. All four pull in the
63
+ transitive dependencies (`rda_python_common`, `rda_python_setuid`,
64
+ `rda_python_miscs`) automatically.
65
+
66
+ For local development, clone this repo alongside your project and install it
67
+ in editable mode so that changes are picked up without re-installing:
67
68
 
68
69
  ```bash
69
- # Compile the pywrapper C binary (once per environment):
70
- pywrapper-install -c|--compile -u|--user gdexdata
70
+ git clone https://github.com/NCAR/rda-python-dsarch.git
71
+ cd rda-python-dsarch
72
+ pip install -e .
73
+ ```
71
74
 
72
- # Wire up dsarch as a setuid entry:
73
- pywrapper-install -l|--link dsarch -u|--user gdexdata
75
+ To test a specific branch (e.g. an in-progress feature or fix branch), pass
76
+ `-b/--branch` to `git clone`:
77
+
78
+ ```bash
79
+ git clone -b <branch-name> https://github.com/NCAR/rda-python-dsarch.git
80
+ cd rda-python-dsarch
81
+ pip install -e .
82
+ ```
83
+
84
+ For a regular (non-editable) install from a checkout:
85
+
86
+ ```bash
87
+ pip install /path/to/rda-python-dsarch
88
+ ```
89
+
90
+ For a production install on a system that uses the published distribution:
91
+
92
+ ```bash
93
+ pip install rda_python_dsarch
94
+ ```
95
+
96
+ ## Setuid Setup
97
+
98
+ `dsarch` is executed as the common user `PGLOG['COMMONUSER']` (default
99
+ `gdexdata`) via the `rda_python_setuid` setuid mechanism, which is pulled
100
+ in automatically as a dependency. After `pip install` above, choose one
101
+ of the wiring options below.
102
+
103
+ > **Note:** If `rda_python_setuid` is already installed and fully set up in
104
+ > your environment, you can skip the compile step (`-c/--compile`) and the
105
+ > optional `pgstart` step (`-p/--pgstart`). The `-l/--link` step is still
106
+ > required to wire up this package's own setuid program.
107
+
108
+ ### Full setuid install (requires sudo access to COMMONUSER)
109
+
110
+ Run these steps once per environment:
111
+
112
+ ```bash
113
+ # 1. Compile the pywrapper C binary (once per environment):
114
+ pywrapper-install -c|--compile -n|--username gdexdata
115
+
116
+ # 2. Wire up dsarch as a setuid entry (or use 'all' to link every setuid_* at once):
117
+ pywrapper-install -l|--link dsarch
118
+ pywrapper-install -l|--link all
119
+
120
+ # 3. Optionally, install a pgstart_<loginname> binary so <loginname> (any
121
+ # user in the same group as PGLOG['COMMONUSER']) can run commands as
122
+ # themselves. Run either by PGLOG['ADMINUSER'] (default zji, if it has
123
+ # 'sudo -u <loginname>'), or by <loginname> directly:
124
+ pywrapper-install -p|--pgstart -n|--username <loginname>
74
125
  ```
75
126
 
76
127
  `pywrapper-install` with no arguments displays the full user guide.
@@ -81,21 +132,25 @@ Users who do not need the setuid mechanism can create a direct symlink instead:
81
132
 
82
133
  ```bash
83
134
  pywrapper-install -l|--link dsarch -s|--simple
135
+ pywrapper-install -l|--link all -s|--simple # or link every setuid_* at once
84
136
  ```
85
137
 
86
138
  This creates `bin/dsarch -> bin/setuid_dsarch` and the program runs as the
87
139
  current user with no privilege change.
88
140
 
89
- ### Setup guide
141
+ ### Update an existing installation (no sudo required)
90
142
 
91
- After `pip install`, run `dsarch-setup` at any time to display the setup guide:
143
+ When the package is upgraded and a new `pywrapper.c` is bundled, recompile and
144
+ reinstall all setuid binaries using the existing `pgstart_*` binaries:
92
145
 
93
146
  ```bash
94
- dsarch-setup
147
+ pywrapper-install -u|--update
95
148
  ```
96
149
 
97
- The guide is also shown automatically if `setuid_dsarch` is invoked directly
98
- before the setuid wrapper has been configured.
150
+ ### Setup guide
151
+
152
+ The shared setuid setup guide is shown automatically if `setuid_dsarch` is
153
+ invoked directly before the setuid wrapper has been configured.
99
154
 
100
155
  ## Documentation sync
101
156
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rda_python_dsarch"
7
- version = "2.0.21"
7
+ version = "3.0.1"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -33,4 +33,3 @@ pythonpath = [
33
33
 
34
34
  [project.scripts]
35
35
  "setuid_dsarch" = "rda_python_dsarch.dsarch:main"
36
- "dsarch-setup" = "rda_python_dsarch.dsarch_setup:main"
@@ -3204,7 +3204,6 @@ class DsArch(PgArch, PgMeta):
3204
3204
  tmpds = tmpgs = None
3205
3205
  bidx = chksize = 0
3206
3206
  bucket = self.PGLOG['OBJCTBKT']
3207
- rcnt = len(self.PGLOG['WEBHOSTS'])
3208
3207
  s = 's' if self.ALLCNT > 1 else ''
3209
3208
  if 'OD' not in self.params:
3210
3209
  self.params['OD'] = dsid
@@ -3353,7 +3352,6 @@ class DsArch(PgArch, PgMeta):
3353
3352
  tmpds = None
3354
3353
  bidx = chksize = 0
3355
3354
  bucket = self.PGLOG['OBJCTBKT']
3356
- rcnt = len(self.PGLOG['WEBHOSTS'])
3357
3355
  s = 's' if self.ALLCNT > 1 else ''
3358
3356
  if 'OD' not in self.params:
3359
3357
  self.params['OD'] = dsid
@@ -3632,7 +3630,6 @@ class DsArch(PgArch, PgMeta):
3632
3630
  bucket = self.PGLOG['OBJCTBKT']
3633
3631
  s = 's' if self.ALLCNT > 1 else ''
3634
3632
  bidx = chksize = 0
3635
- rcnt = len(self.PGLOG['WEBHOSTS'])
3636
3633
  self.pglog("Delete {} Web file{} from {} ...".format(self.ALLCNT, s, dsid), self.WARNLG)
3637
3634
  reorder = metatotal = metacnt = dcnt = mcnt = ocnt = wcnt = 0
3638
3635
  self.cache_group_info(self.ALLCNT, 0)
@@ -3741,7 +3738,6 @@ class DsArch(PgArch, PgMeta):
3741
3738
  dcnd = "dsid = '{}'".format(dsid)
3742
3739
  s = 's' if self.ALLCNT > 1 else ''
3743
3740
  bidx = chksize = 0
3744
- rcnt = len(self.PGLOG['WEBHOSTS'])
3745
3741
  self.pglog("Delete {} Help file{} from {} ...".format(self.ALLCNT, s, dsid), self.WARNLG)
3746
3742
  reorder = dcnt = hcnt = ocnt = mcnt = 0
3747
3743
  self.cache_group_info(self.ALLCNT, 0)
@@ -3787,9 +3783,7 @@ class DsArch(PgArch, PgMeta):
3787
3783
  if pgrec['url']:
3788
3784
  fcnt = 1
3789
3785
  else:
3790
- fcnt = 0
3791
- for j in range(rcnt):
3792
- fcnt += self.delete_local_file(afile, self.PGOPT['emerol'])
3786
+ fcnt = self.delete_local_file(afile, self.PGOPT['emerol'])
3793
3787
  if fcnt:
3794
3788
  hcnt += 1
3795
3789
  hflag = 0
@@ -4957,11 +4951,9 @@ def main():
4957
4951
  Instantiates DsArch, parses arguments via read_parameters(), executes the
4958
4952
  requested action via start_actions(), and exits cleanly.
4959
4953
  """
4960
- import sys
4961
- if os.path.basename(sys.argv[0]) == 'setuid_dsarch':
4962
- from rda_python_dsarch.dsarch_setup import main as setup_main
4963
- setup_main()
4954
+ from rda_python_setuid.setup_guide import show_setup_guide
4964
4955
  object = DsArch()
4956
+ show_setup_guide(object, 'rda_python_dsarch', ['dsarch'])
4965
4957
  object.read_parameters()
4966
4958
  object.start_actions()
4967
4959
  object.pgexit(0)
@@ -11,6 +11,14 @@ reference. Files can be organized into nested sub-products called groups.
11
11
  Any metadata stored in GDEXDB can also be retrieved or updated through
12
12
  'dsarch'.
13
13
 
14
+ By default, 'dsarch' runs as the common user (default 'gdexdata') through
15
+ the rda_python_setuid setuid mechanism, so that data files are archived and
16
+ owned under the common user, and all GDEXDB records are written as the
17
+ common user, regardless of which specialist invokes the command. 'dsarch'
18
+ can also be executed directly as an individual specialist without the
19
+ setuid mechanism, in which case archived files are owned by that
20
+ specialist.
21
+
14
22
  A few terms used throughout this document:
15
23
  GDEX - Geoscience Data Exchange, NCAR's data publication platform
16
24
  GDEXDB - the metadata database backing GDEX
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dsarch
3
- Version: 2.0.21
3
+ Version: 3.0.1
4
4
  Summary: RDA Python package for utility program dsarch archive RDA data
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dsarch
@@ -56,39 +56,90 @@ The inheritance chain is `DsArch -> PgArch -> PgMeta -> PgCMD/PgSplit`, so
56
56
  `DsArch` instances expose every option, path, count, and database helper
57
57
  through a single object.
58
58
 
59
- ## Setuid Setup
60
-
61
- `dsarch` is executed as the common user `gdexdata` via the `rda_python_setuid`
62
- setuid mechanism. `rda_python_setuid` is declared as a dependency and is
63
- installed automatically with this package.
59
+ ## Environment setup
64
60
 
65
- ### Environment setup
61
+ Create a Python environment first; package installs in the next section run
62
+ inside whichever environment you activate here.
66
63
 
67
- #### Option A — Python venv (DECS machines)
64
+ ### Option A — Python venv (DECS machines)
68
65
 
69
66
  ```bash
70
67
  python3 -m venv $ENVHOME # e.g. /glade/u/home/gdexdata/gdexmsenv
71
68
  source $ENVHOME/bin/activate
72
- pip install rda_python_dsarch
73
69
  ```
74
70
 
75
- #### Option B — Conda (DAV/Casper)
71
+ ### Option B — Conda (DAV/Casper)
76
72
 
77
73
  ```bash
78
- conda activate pg-gdex # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
79
- pip install rda_python_dsarch
74
+ conda create --prefix $ENVHOME python=3.12 # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
75
+ conda activate $ENVHOME
80
76
  ```
81
77
 
82
- ### Full setuid install (requires sudo access to gdexdata)
78
+ ## Installing rda-python-dsarch
83
79
 
84
- Run these steps once per environment after `pip install`:
80
+ Pick whichever install mode fits your workflow. All four pull in the
81
+ transitive dependencies (`rda_python_common`, `rda_python_setuid`,
82
+ `rda_python_miscs`) automatically.
83
+
84
+ For local development, clone this repo alongside your project and install it
85
+ in editable mode so that changes are picked up without re-installing:
85
86
 
86
87
  ```bash
87
- # Compile the pywrapper C binary (once per environment):
88
- pywrapper-install -c|--compile -u|--user gdexdata
88
+ git clone https://github.com/NCAR/rda-python-dsarch.git
89
+ cd rda-python-dsarch
90
+ pip install -e .
91
+ ```
89
92
 
90
- # Wire up dsarch as a setuid entry:
91
- pywrapper-install -l|--link dsarch -u|--user gdexdata
93
+ To test a specific branch (e.g. an in-progress feature or fix branch), pass
94
+ `-b/--branch` to `git clone`:
95
+
96
+ ```bash
97
+ git clone -b <branch-name> https://github.com/NCAR/rda-python-dsarch.git
98
+ cd rda-python-dsarch
99
+ pip install -e .
100
+ ```
101
+
102
+ For a regular (non-editable) install from a checkout:
103
+
104
+ ```bash
105
+ pip install /path/to/rda-python-dsarch
106
+ ```
107
+
108
+ For a production install on a system that uses the published distribution:
109
+
110
+ ```bash
111
+ pip install rda_python_dsarch
112
+ ```
113
+
114
+ ## Setuid Setup
115
+
116
+ `dsarch` is executed as the common user `PGLOG['COMMONUSER']` (default
117
+ `gdexdata`) via the `rda_python_setuid` setuid mechanism, which is pulled
118
+ in automatically as a dependency. After `pip install` above, choose one
119
+ of the wiring options below.
120
+
121
+ > **Note:** If `rda_python_setuid` is already installed and fully set up in
122
+ > your environment, you can skip the compile step (`-c/--compile`) and the
123
+ > optional `pgstart` step (`-p/--pgstart`). The `-l/--link` step is still
124
+ > required to wire up this package's own setuid program.
125
+
126
+ ### Full setuid install (requires sudo access to COMMONUSER)
127
+
128
+ Run these steps once per environment:
129
+
130
+ ```bash
131
+ # 1. Compile the pywrapper C binary (once per environment):
132
+ pywrapper-install -c|--compile -n|--username gdexdata
133
+
134
+ # 2. Wire up dsarch as a setuid entry (or use 'all' to link every setuid_* at once):
135
+ pywrapper-install -l|--link dsarch
136
+ pywrapper-install -l|--link all
137
+
138
+ # 3. Optionally, install a pgstart_<loginname> binary so <loginname> (any
139
+ # user in the same group as PGLOG['COMMONUSER']) can run commands as
140
+ # themselves. Run either by PGLOG['ADMINUSER'] (default zji, if it has
141
+ # 'sudo -u <loginname>'), or by <loginname> directly:
142
+ pywrapper-install -p|--pgstart -n|--username <loginname>
92
143
  ```
93
144
 
94
145
  `pywrapper-install` with no arguments displays the full user guide.
@@ -99,21 +150,25 @@ Users who do not need the setuid mechanism can create a direct symlink instead:
99
150
 
100
151
  ```bash
101
152
  pywrapper-install -l|--link dsarch -s|--simple
153
+ pywrapper-install -l|--link all -s|--simple # or link every setuid_* at once
102
154
  ```
103
155
 
104
156
  This creates `bin/dsarch -> bin/setuid_dsarch` and the program runs as the
105
157
  current user with no privilege change.
106
158
 
107
- ### Setup guide
159
+ ### Update an existing installation (no sudo required)
108
160
 
109
- After `pip install`, run `dsarch-setup` at any time to display the setup guide:
161
+ When the package is upgraded and a new `pywrapper.c` is bundled, recompile and
162
+ reinstall all setuid binaries using the existing `pgstart_*` binaries:
110
163
 
111
164
  ```bash
112
- dsarch-setup
165
+ pywrapper-install -u|--update
113
166
  ```
114
167
 
115
- The guide is also shown automatically if `setuid_dsarch` is invoked directly
116
- before the setuid wrapper has been configured.
168
+ ### Setup guide
169
+
170
+ The shared setuid setup guide is shown automatically if `setuid_dsarch` is
171
+ invoked directly before the setuid wrapper has been configured.
117
172
 
118
173
  ## Documentation sync
119
174
 
@@ -8,7 +8,6 @@ src/rda_python_dsarch/__init__.py
8
8
  src/rda_python_dsarch/ds_arch.py
9
9
  src/rda_python_dsarch/dsarch.py
10
10
  src/rda_python_dsarch/dsarch.usg
11
- src/rda_python_dsarch/dsarch_setup.py
12
11
  src/rda_python_dsarch/pg_arch.py
13
12
  src/rda_python_dsarch/pg_meta.py
14
13
  src/rda_python_dsarch.egg-info/PKG-INFO
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
- dsarch-setup = rda_python_dsarch.dsarch_setup:main
3
2
  setuid_dsarch = rda_python_dsarch.dsarch:main
@@ -1,69 +0,0 @@
1
- #!/usr/bin/env python3
2
- #
3
- ##################################################################################
4
- #
5
- # Title: dsarch-setup
6
- # Author: Zaihua Ji, zji@ucar.edu
7
- # Date: 2026-05-12
8
- # Purpose: Display the setuid setup guide for dsarch after pip install.
9
- # Run automatically when setuid_dsarch is invoked directly instead
10
- # of through the dsarch -> pywrapper setuid symlink.
11
- #
12
- # Github: https://github.com/NCAR/rda-python-dsarch.git
13
- #
14
- ##################################################################################
15
-
16
- import os
17
- import sys
18
-
19
-
20
- SETUP_GUIDE = """
21
- dsarch - Setuid Setup Guide
22
- ===========================
23
-
24
- dsarch must be run as the common user 'gdexdata' via the rda_python_setuid
25
- mechanism. rda_python_setuid is installed automatically as a dependency.
26
-
27
- If you are seeing this message after running 'setuid_dsarch' directly, it
28
- means the setuid wrapper has not been set up yet. Follow the steps below.
29
-
30
- Run 'pywrapper-install' with no arguments for the full pywrapper user guide.
31
-
32
- Environment Setup
33
- -----------------
34
-
35
- Option A - Python venv (DECS machines):
36
- python3 -m venv $ENVHOME # e.g. /glade/u/home/gdexdata/gdexmsenv
37
- source $ENVHOME/bin/activate
38
- pip install rda_python_dsarch
39
-
40
- Option B - Conda (DAV/Casper):
41
- conda activate pg-gdex # e.g. /glade/work/gdexdata/conda-envs/pg-gdex
42
- pip install rda_python_dsarch
43
-
44
- Full Setuid Install (requires sudo access to gdexdata)
45
- ------------------------------------------------------
46
-
47
- # Compile the pywrapper C binary (once per environment):
48
- pywrapper-install -c|--compile -u|--user gdexdata
49
-
50
- # Wire up dsarch as a setuid entry:
51
- pywrapper-install -l|--link dsarch -u|--user gdexdata
52
-
53
- Simple Install (no sudo required, runs as current user)
54
- -------------------------------------------------------
55
-
56
- pywrapper-install -l|--link dsarch -s|--simple
57
-
58
- This creates bin/dsarch -> bin/setuid_dsarch.
59
- The program runs as the current user with no privilege change.
60
-
61
- """
62
-
63
-
64
- def main():
65
- print(SETUP_GUIDE)
66
- sys.exit(0)
67
-
68
-
69
- if __name__ == '__main__': main()