lmod-toolkit 0.0.6__tar.gz → 0.0.7__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.
- {lmod_toolkit-0.0.6/src/lmod_toolkit.egg-info → lmod_toolkit-0.0.7}/PKG-INFO +2 -2
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/README.md +6 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/pyproject.toml +0 -1
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/setup.sh +21 -8
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/__init__.py +1 -1
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/_version.py +3 -3
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/bin/lmtk.sh +1 -1
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/cli.py +3 -3
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/config.py +5 -1
- lmod_toolkit-0.0.7/src/lmod_toolkit/examples/common.toml.sample +33 -0
- lmod_toolkit-0.0.7/src/lmod_toolkit/http.py +62 -0
- lmod_toolkit-0.0.7/src/lmod_toolkit/publish.py +95 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7/src/lmod_toolkit.egg-info}/PKG-INFO +2 -2
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit.egg-info/SOURCES.txt +2 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit.egg-info/scm_file_list.json +2 -0
- lmod_toolkit-0.0.7/src/lmod_toolkit.egg-info/scm_version.json +8 -0
- lmod_toolkit-0.0.7/utils/README.md +18 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/utils/uv_installer.sh +25 -25
- lmod_toolkit-0.0.6/src/lmod_toolkit/examples/common.toml.sample +0 -28
- lmod_toolkit-0.0.6/src/lmod_toolkit/publish.py +0 -61
- lmod_toolkit-0.0.6/src/lmod_toolkit.egg-info/scm_version.json +0 -8
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/.github/workflows/publish-to-test-pypi.yml +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/.gitignore +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/README.pypi +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/setup.cfg +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/__main__.py +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/build_helper.py +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/lmod_config.py +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/lmod_ext_attrs.py +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/lmod_spider.py +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/logging_config.py +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/metadata.py +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit/test.py +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit.egg-info/dependency_links.txt +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit.egg-info/requires.txt +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/src/lmod_toolkit.egg-info/top_level.txt +0 -0
- {lmod_toolkit-0.0.6 → lmod_toolkit-0.0.7}/utils/quickstart.sh +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lmod-toolkit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary: ACCESS Lmod Toolkit
|
|
5
|
-
Author-email: Andy Loftus <aloftus@illinois.edu
|
|
5
|
+
Author-email: Andy Loftus <aloftus@illinois.edu>
|
|
6
6
|
Project-URL: Repository, https://github.com/access-ci-org/lmod-toolkit
|
|
7
7
|
Keywords: monitoring,information,gathering,publishing
|
|
8
8
|
Classifier: Development Status :: 1 - Planning
|
|
@@ -9,8 +9,14 @@ https://raw.githubusercontent.com/access-ci-org/lmod-toolkit/refs/heads/main/set
|
|
|
9
9
|
* `~/lmod-toolkit/bin/mkcfg.sh`
|
|
10
10
|
* Edit config file (from previous step)
|
|
11
11
|
* `~/lmod-toolkit/bin/test.sh`
|
|
12
|
+
* Add api token to .netrc
|
|
13
|
+
* machine opsapi3.access-ci.org
|
|
14
|
+
* account API_ACCESS_TOKEN
|
|
12
15
|
* `~/lmod-toolkit/bin/publish.sh`
|
|
13
16
|
|
|
17
|
+
## Alternate install methods
|
|
18
|
+
* [Quickstart](utils/README.md)
|
|
19
|
+
|
|
14
20
|
# Design
|
|
15
21
|
Config holds a list of Resource Definitions to be reported on.
|
|
16
22
|
|
|
@@ -31,6 +31,9 @@ GREEN='\033[0;32m'
|
|
|
31
31
|
RED='\033[0;31m'
|
|
32
32
|
NC='\033[0m' # No Color
|
|
33
33
|
|
|
34
|
+
export UV_NO_CACHE=1
|
|
35
|
+
export UV_MANAGED_PYTHON=1
|
|
36
|
+
|
|
34
37
|
|
|
35
38
|
err() {
|
|
36
39
|
echo -e "${RED}✗ ERROR: $*${NC}"
|
|
@@ -83,8 +86,6 @@ mk_venv() {
|
|
|
83
86
|
[[ $DEBUG -eq $YES ]] && set -x
|
|
84
87
|
[[ -d "$VENV" ]] || {
|
|
85
88
|
export UV_PYTHON_INSTALL_DIR="${UV_DIR}"/python
|
|
86
|
-
export UV_NO_CACHE=1
|
|
87
|
-
export UV_MANAGED_PYTHON=1
|
|
88
89
|
# allow override python version
|
|
89
90
|
[[ -n "${LMTK_UV_PYTHON}" ]] && UV_PYTHON="${LMTK_UV_PYTHON}"
|
|
90
91
|
export UV_PYTHON
|
|
@@ -134,17 +135,29 @@ is_upgrade_allowed() {
|
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
|
|
138
|
+
install_lmod_toolkit_prerelease() {
|
|
139
|
+
local -a _cli_opts
|
|
140
|
+
_cli_opts+=(
|
|
141
|
+
'--index' 'https://test.pypi.org/simple'
|
|
142
|
+
'--prerelease-package' 'lmod-toolkit=allow'
|
|
143
|
+
'--no-deps'
|
|
144
|
+
)
|
|
145
|
+
is_upgrade_allowed && _cli_opts+=( '--upgrade' )
|
|
146
|
+
pushd "${INSTALL_DIR}"
|
|
147
|
+
# Install from test.pypi
|
|
148
|
+
"${UV}" pip install "${_cli_opts[@]}" \
|
|
149
|
+
lmod-toolkit"${LMTK_INSTALL_VERSION:+==$LMTK_INSTALL_VERSION}"
|
|
150
|
+
popd
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
137
154
|
install_lmod_toolkit() {
|
|
138
155
|
[[ $DEBUG -eq $YES ]] && set -x
|
|
139
156
|
local -a _cli_opts
|
|
140
|
-
is_upgrade_allowed && {
|
|
141
|
-
_cli_opts+=( '--upgrade' )
|
|
142
|
-
}
|
|
143
157
|
is_pre_release_allowed && {
|
|
144
|
-
|
|
145
|
-
_cli_opts+=( '--prerelease-package' 'lmod-toolkit=allow' )
|
|
158
|
+
install_lmod_toolkit_prerelease
|
|
146
159
|
}
|
|
147
|
-
|
|
160
|
+
is_upgrade_allowed && _cli_opts+=( '--upgrade' )
|
|
148
161
|
pushd "${INSTALL_DIR}"
|
|
149
162
|
"${UV}" pip install \
|
|
150
163
|
"${_cli_opts[@]}" \
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
21
|
+
__version__ = version = '0.0.7'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 0, 7)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g8c7a0fca7'
|
|
@@ -52,11 +52,11 @@ def mkcfg():
|
|
|
52
52
|
msg = str( e )
|
|
53
53
|
else:
|
|
54
54
|
msg = dedent( f"""
|
|
55
|
-
New config file: '{lmtk.config.
|
|
55
|
+
New config file: '{lmtk.config.get_config_path()}'
|
|
56
56
|
You MUST add at least one valid resource to the config before publishing.
|
|
57
57
|
Next Steps:
|
|
58
|
-
1. Edit the config file '{lmtk.config.
|
|
59
|
-
2. Test with: '~/lmod-toolkit/bin/
|
|
58
|
+
1. Edit the config file '{lmtk.config.get_config_path()}'
|
|
59
|
+
2. Test with: '~/lmod-toolkit/bin/test.sh'
|
|
60
60
|
""").strip( "\n" )
|
|
61
61
|
return( msg )
|
|
62
62
|
|
|
@@ -44,7 +44,7 @@ def mk_config():
|
|
|
44
44
|
if cfg_path.exists():
|
|
45
45
|
raise UserWarning( f"ConfigFile '{cfg_path}' exists, refusing to overwrite" )
|
|
46
46
|
# get module install dir
|
|
47
|
-
pkg_dir = lmtk.metadata.
|
|
47
|
+
pkg_dir = lmtk.metadata.pkg_install_dir
|
|
48
48
|
cfg_sample = pkg_dir / 'examples' / 'common.toml.sample'
|
|
49
49
|
encoding='utf-8'
|
|
50
50
|
sample_text = cfg_sample.read_text( encoding=encoding )
|
|
@@ -67,3 +67,7 @@ def iter_resources():
|
|
|
67
67
|
|
|
68
68
|
def get_current_resource_definition():
|
|
69
69
|
return module_resources['current_resource_definition']
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def __getattr__( name ):
|
|
73
|
+
return( get_config()[name] )
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[[resources]]
|
|
2
|
+
# MUST SPECIFY EXACTLY ONE OF info_resourceid OR info_groupid
|
|
3
|
+
|
|
4
|
+
# Resource ID is the name defined in cider.access-ci.org
|
|
5
|
+
# Specify info_resourceid to either override the defaults published for info_groupid
|
|
6
|
+
# of if there is no data published for info_groupid
|
|
7
|
+
# [REQUIRED] string: ( set ONLY ONE of info_resourceid" or "info_groupid" )
|
|
8
|
+
#info_resourceid = "my.resource.access-ci.org"
|
|
9
|
+
|
|
10
|
+
# Group ID is the name defined at:
|
|
11
|
+
# https://operations-api.access-ci.org/wh2/cider/v1/access-active-groups/
|
|
12
|
+
# The info_groupid can be used to publish a set of default software modules
|
|
13
|
+
# to be used for all the resources under said group
|
|
14
|
+
# [REQUIRED] string: ( set ONLY ONE of "info_groupid" or "info_resourceid")
|
|
15
|
+
#info_groupid = "my.site.access-ci.org"
|
|
16
|
+
|
|
17
|
+
# Specify a custom module path to use instead of MODULEPATH environment variable
|
|
18
|
+
# [OPTIONAL] string: same format and purpose of MODULEPATH
|
|
19
|
+
# module_path =
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# Can specify multiple resources.
|
|
23
|
+
# Data for each unique resourceid OR groupid will be published in turn.
|
|
24
|
+
#[[resources]]
|
|
25
|
+
#info_resourceid = "my-other-resource.access-ci.org"
|
|
26
|
+
#info_groupid =
|
|
27
|
+
#module_path =
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# Details for the OPS API server
|
|
31
|
+
[server]
|
|
32
|
+
host = "opsapi3.access-ci.org"
|
|
33
|
+
path = "wh2/publish/v1/jsondocument/"
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Interact with the ACCESS OPS API
|
|
2
|
+
import functools
|
|
3
|
+
import logging
|
|
4
|
+
import netrc
|
|
5
|
+
import pprint
|
|
6
|
+
import requests
|
|
7
|
+
|
|
8
|
+
import lmod_toolkit as lmtk
|
|
9
|
+
|
|
10
|
+
logr = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@functools.cache
|
|
14
|
+
def get_session():
|
|
15
|
+
s = requests.Session()
|
|
16
|
+
s.trust_env = False #disable netrc lookup in requests
|
|
17
|
+
return s
|
|
18
|
+
|
|
19
|
+
@functools.cache
|
|
20
|
+
def get_netrc():
|
|
21
|
+
n = netrc.netrc()
|
|
22
|
+
host = lmtk.config.server['host']
|
|
23
|
+
(login, account, password) = n.authenticators( host )
|
|
24
|
+
return {
|
|
25
|
+
'login': login,
|
|
26
|
+
'account': account,
|
|
27
|
+
'password': password,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def get_account():
|
|
33
|
+
return get_netrc()['account']
|
|
34
|
+
|
|
35
|
+
get_api_token = get_account
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def api_go( method: str, **kw ):
|
|
40
|
+
host = lmtk.config.server['host']
|
|
41
|
+
path = lmtk.config.server['path']
|
|
42
|
+
url = f'https://{host}/{path}'
|
|
43
|
+
headers = {
|
|
44
|
+
'Authorization': f'Basic {get_api_token()}'
|
|
45
|
+
}
|
|
46
|
+
if 'headers' in kw:
|
|
47
|
+
kw['headers'].update( headers )
|
|
48
|
+
else:
|
|
49
|
+
kw['headers'] = headers
|
|
50
|
+
logr.debug( f'{method}, {url}, {pprint.pformat(kw)}' )
|
|
51
|
+
r = get_session().request( method, url, **kw )
|
|
52
|
+
logr.debug(f'RETURN CODE .. {r}' )
|
|
53
|
+
r.raise_for_status()
|
|
54
|
+
return r
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def api_post_gzip( data, **kw):
|
|
58
|
+
headers = {
|
|
59
|
+
"Content-Type": "application/json",
|
|
60
|
+
"Content-Encoding": "gzip",
|
|
61
|
+
}
|
|
62
|
+
return api_go( method='POST', data=data, headers=headers, **kw )
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
import gzip
|
|
3
|
+
import importlib
|
|
4
|
+
import json
|
|
5
|
+
import logging
|
|
6
|
+
import re
|
|
7
|
+
import time
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from textwrap import dedent
|
|
11
|
+
|
|
12
|
+
import lmod_toolkit as lmtk
|
|
13
|
+
|
|
14
|
+
logr = logging.getLogger( __name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
'get_resource_data',
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
data_functions = [
|
|
22
|
+
'lmod_spider',
|
|
23
|
+
'lmod_ext_attrs',
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def go():
|
|
28
|
+
lmtk_metadata = lmtk.metadata.as_dict()
|
|
29
|
+
lmod_config_data = lmtk.lmod_config.as_dict()
|
|
30
|
+
for resource_definition in lmtk.config.iter_resources():
|
|
31
|
+
for pymod_name in data_functions:
|
|
32
|
+
pymod = importlib.import_module( f"lmod_toolkit.{pymod_name}" )
|
|
33
|
+
data_to_publish = {
|
|
34
|
+
'resource': resource_definition,
|
|
35
|
+
'lmod_toolkit': lmtk.metadata.as_dict(),
|
|
36
|
+
'manifest': { 'data_type': pymod_name },
|
|
37
|
+
'payload': pymod.as_dict(),
|
|
38
|
+
}
|
|
39
|
+
outfn = write_to_local_file(
|
|
40
|
+
data=data_to_publish,
|
|
41
|
+
resource=mk_clean_resource( resource_definition ),
|
|
42
|
+
datatype=pymod_name
|
|
43
|
+
)
|
|
44
|
+
logr.info( f'Wrote {pymod_name} data to file {outfn}' )
|
|
45
|
+
upload_http(
|
|
46
|
+
data=data_to_publish,
|
|
47
|
+
about=mk_about( resource_definition ),
|
|
48
|
+
topic=pymod_name
|
|
49
|
+
)
|
|
50
|
+
logr.info( f'Published {pymod_name} data to http endpoint' )
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def mk_clean_resource( resource_def ):
|
|
54
|
+
about = mk_about( resource_def )
|
|
55
|
+
only_ascii = about.replace( ':', '-' )
|
|
56
|
+
return only_ascii
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def mk_about( resource_def ):
|
|
60
|
+
simple_chars = re.sub(
|
|
61
|
+
r"[^A-Za-z0-9.:_-]",
|
|
62
|
+
"",
|
|
63
|
+
str( resource_def )
|
|
64
|
+
)
|
|
65
|
+
return simple_chars
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def write_to_local_file( data: dict, resource: str, datatype: str) -> Path:
|
|
69
|
+
# make output filename
|
|
70
|
+
ts = int( time.time() )
|
|
71
|
+
timestamp = datetime.datetime.fromtimestamp( ts, tz=datetime.timezone.utc )
|
|
72
|
+
fn_suffix = timestamp.strftime( '%F_%T%z' )
|
|
73
|
+
outfile = lmtk.metadata.data_dir / f"{resource}-{datatype}.{fn_suffix}"
|
|
74
|
+
|
|
75
|
+
# write data
|
|
76
|
+
with outfile.open( mode='w', encoding='utf-8' ) as fh:
|
|
77
|
+
json.dump( data, fh, default=str )
|
|
78
|
+
|
|
79
|
+
return outfile
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def upload_http( data: dict, about: str, topic: str ) -> None:
|
|
83
|
+
''' Compress and upload json data to a web API via HTTP.
|
|
84
|
+
See also: https://github.com/andylytical/jira-tools/blob/main/web_api.py
|
|
85
|
+
'''
|
|
86
|
+
# gzip compress the contents
|
|
87
|
+
gzdata = gzip.compress( json.dumps( data, default=str ).encode('utf-8') )
|
|
88
|
+
|
|
89
|
+
# pass it off to api_post
|
|
90
|
+
# params are values to add to the URL, like in a GET request
|
|
91
|
+
params = {
|
|
92
|
+
'about': about,
|
|
93
|
+
'topic': topic,
|
|
94
|
+
}
|
|
95
|
+
lmtk.http.api_post_gzip( data=gzdata, params=params )
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lmod-toolkit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary: ACCESS Lmod Toolkit
|
|
5
|
-
Author-email: Andy Loftus <aloftus@illinois.edu
|
|
5
|
+
Author-email: Andy Loftus <aloftus@illinois.edu>
|
|
6
6
|
Project-URL: Repository, https://github.com/access-ci-org/lmod-toolkit
|
|
7
7
|
Keywords: monitoring,information,gathering,publishing
|
|
8
8
|
Classifier: Development Status :: 1 - Planning
|
|
@@ -10,6 +10,7 @@ src/lmod_toolkit/_version.py
|
|
|
10
10
|
src/lmod_toolkit/build_helper.py
|
|
11
11
|
src/lmod_toolkit/cli.py
|
|
12
12
|
src/lmod_toolkit/config.py
|
|
13
|
+
src/lmod_toolkit/http.py
|
|
13
14
|
src/lmod_toolkit/lmod_config.py
|
|
14
15
|
src/lmod_toolkit/lmod_ext_attrs.py
|
|
15
16
|
src/lmod_toolkit/lmod_spider.py
|
|
@@ -26,5 +27,6 @@ src/lmod_toolkit.egg-info/scm_version.json
|
|
|
26
27
|
src/lmod_toolkit.egg-info/top_level.txt
|
|
27
28
|
src/lmod_toolkit/bin/lmtk.sh
|
|
28
29
|
src/lmod_toolkit/examples/common.toml.sample
|
|
30
|
+
utils/README.md
|
|
29
31
|
utils/quickstart.sh
|
|
30
32
|
utils/uv_installer.sh
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"src/lmod_toolkit/cli.py",
|
|
14
14
|
"src/lmod_toolkit/config.py",
|
|
15
15
|
"src/lmod_toolkit/examples/common.toml.sample",
|
|
16
|
+
"src/lmod_toolkit/http.py",
|
|
16
17
|
"src/lmod_toolkit/lmod_config.py",
|
|
17
18
|
"src/lmod_toolkit/lmod_ext_attrs.py",
|
|
18
19
|
"src/lmod_toolkit/lmod_spider.py",
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
"src/lmod_toolkit/metadata.py",
|
|
21
22
|
"src/lmod_toolkit/publish.py",
|
|
22
23
|
"src/lmod_toolkit/test.py",
|
|
24
|
+
"utils/README.md",
|
|
23
25
|
"utils/quickstart.sh",
|
|
24
26
|
"utils/uv_installer.sh"
|
|
25
27
|
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
Note: This will DELETE your current install and make a new fresh install.
|
|
3
|
+
That's usually okay, since configs are stored outside of the install dir.
|
|
4
|
+
|
|
5
|
+
Note: It will NOT delete everything iff LMTK_ALLOW_UPGRADE=yes.
|
|
6
|
+
|
|
7
|
+
* `curl -o ~/lmtk-quickstart.sh
|
|
8
|
+
https://raw.githubusercontent.com/access-ci-org/lmod-toolkit/refs/heads/main/utils/quickstart.sh`
|
|
9
|
+
* Edit the variables at the top as needed
|
|
10
|
+
* `bash ~/lmtk-quickstart.sh`
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Update UV installer
|
|
14
|
+
* https://github.com/astral-sh/uv/releases
|
|
15
|
+
* Look for `Install prebuilt binaries via shell script`
|
|
16
|
+
* Look for the `curl` command
|
|
17
|
+
* Run that curl command without piping to shell
|
|
18
|
+
* Use `-o uv_installer.sh` to save it to the local file
|
|
@@ -24,19 +24,19 @@ has_local 2>/dev/null || alias local=typeset
|
|
|
24
24
|
set -u
|
|
25
25
|
|
|
26
26
|
APP_NAME="uv"
|
|
27
|
-
APP_VERSION="0.13.
|
|
27
|
+
APP_VERSION="0.13.13"
|
|
28
28
|
if [ -n "${UV_DOWNLOAD_URL:-}" ]; then
|
|
29
29
|
ARTIFACT_DOWNLOAD_URLS="$UV_DOWNLOAD_URL"
|
|
30
30
|
elif [ -n "${INSTALLER_DOWNLOAD_URL:-}" ]; then
|
|
31
31
|
ARTIFACT_DOWNLOAD_URLS="$INSTALLER_DOWNLOAD_URL"
|
|
32
32
|
elif [ -n "${UV_INSTALLER_GHE_BASE_URL:-}" ]; then
|
|
33
33
|
INSTALLER_BASE_URL="$UV_INSTALLER_GHE_BASE_URL"
|
|
34
|
-
ARTIFACT_DOWNLOAD_URLS="${INSTALLER_BASE_URL}/astral-sh/uv/releases/download/0.13.
|
|
34
|
+
ARTIFACT_DOWNLOAD_URLS="${INSTALLER_BASE_URL}/astral-sh/uv/releases/download/0.13.13"
|
|
35
35
|
elif [ -n "${UV_INSTALLER_GITHUB_BASE_URL:-}" ]; then
|
|
36
36
|
INSTALLER_BASE_URL="$UV_INSTALLER_GITHUB_BASE_URL"
|
|
37
|
-
ARTIFACT_DOWNLOAD_URLS="${INSTALLER_BASE_URL}/astral-sh/uv/releases/download/0.13.
|
|
37
|
+
ARTIFACT_DOWNLOAD_URLS="${INSTALLER_BASE_URL}/astral-sh/uv/releases/download/0.13.13"
|
|
38
38
|
else
|
|
39
|
-
ARTIFACT_DOWNLOAD_URLS="https://releases.astral.sh/github/uv/releases/download/0.13.
|
|
39
|
+
ARTIFACT_DOWNLOAD_URLS="https://releases.astral.sh/github/uv/releases/download/0.13.13 https://github.com/astral-sh/uv/releases/download/0.13.13"
|
|
40
40
|
fi
|
|
41
41
|
if [ -n "${UV_PRINT_VERBOSE:-}" ]; then
|
|
42
42
|
PRINT_VERBOSE="$UV_PRINT_VERBOSE"
|
|
@@ -66,7 +66,7 @@ fi
|
|
|
66
66
|
AUTH_TOKEN="${UV_GITHUB_TOKEN:-}"
|
|
67
67
|
|
|
68
68
|
read -r RECEIPT <<EORECEIPT
|
|
69
|
-
{"binaries":["CARGO_DIST_BINS"],"binary_aliases":{},"cdylibs":["CARGO_DIST_DYLIBS"],"cstaticlibs":["CARGO_DIST_STATICLIBS"],"install_layout":"unspecified","install_prefix":"AXO_INSTALL_PREFIX","modify_path":true,"provider":{"source":"cargo-dist","version":"0.32.0"},"source":{"app_name":"uv","name":"uv","owner":"astral-sh","release_type":"github"},"version":"0.13.
|
|
69
|
+
{"binaries":["CARGO_DIST_BINS"],"binary_aliases":{},"cdylibs":["CARGO_DIST_DYLIBS"],"cstaticlibs":["CARGO_DIST_STATICLIBS"],"install_layout":"unspecified","install_prefix":"AXO_INSTALL_PREFIX","modify_path":true,"provider":{"source":"cargo-dist","version":"0.32.0"},"source":{"app_name":"uv","name":"uv","owner":"astral-sh","release_type":"github"},"version":"0.13.13"}
|
|
70
70
|
EORECEIPT
|
|
71
71
|
|
|
72
72
|
# Some Linux distributions don't set HOME
|
|
@@ -120,10 +120,10 @@ usage() {
|
|
|
120
120
|
cat <<EOF
|
|
121
121
|
uv-installer.sh
|
|
122
122
|
|
|
123
|
-
The installer for uv 0.13.
|
|
123
|
+
The installer for uv 0.13.13
|
|
124
124
|
|
|
125
125
|
This script detects what platform you're on and fetches an appropriate archive from
|
|
126
|
-
https://releases.astral.sh/github/uv/releases/download/0.13.
|
|
126
|
+
https://releases.astral.sh/github/uv/releases/download/0.13.13
|
|
127
127
|
then unpacks the binaries and installs them to the first of the following locations
|
|
128
128
|
|
|
129
129
|
\$XDG_BIN_HOME
|
|
@@ -228,7 +228,7 @@ download_binary_and_run_installer() {
|
|
|
228
228
|
_arch="aarch64-apple-darwin"
|
|
229
229
|
_zip_ext=".tar.gz"
|
|
230
230
|
_checksum_style="sha256"
|
|
231
|
-
_checksum_value="
|
|
231
|
+
_checksum_value="9e859ab62a9ad9a37ad8f33bb6982fd1529f1d6cd166355b77eb30fec703a5e5"
|
|
232
232
|
_bins="uv uvx"
|
|
233
233
|
_bins_js_array='"uv","uvx"'
|
|
234
234
|
_libs=""
|
|
@@ -242,7 +242,7 @@ download_binary_and_run_installer() {
|
|
|
242
242
|
_arch="aarch64-pc-windows-msvc"
|
|
243
243
|
_zip_ext=".zip"
|
|
244
244
|
_checksum_style="sha256"
|
|
245
|
-
_checksum_value="
|
|
245
|
+
_checksum_value="c01879cbb34ff21add63abe9a3ff44ce164eebf630b559b9a0fc3776604a86b9"
|
|
246
246
|
_bins="uv.exe uvx.exe uvw.exe"
|
|
247
247
|
_bins_js_array='"uv.exe","uvx.exe","uvw.exe"'
|
|
248
248
|
_libs=""
|
|
@@ -256,7 +256,7 @@ download_binary_and_run_installer() {
|
|
|
256
256
|
_arch="aarch64-unknown-linux-gnu"
|
|
257
257
|
_zip_ext=".tar.gz"
|
|
258
258
|
_checksum_style="sha256"
|
|
259
|
-
_checksum_value="
|
|
259
|
+
_checksum_value="0fde2c32458c8679c6abfd391a99a3c313527d777859ac2331aa9882bff0aa9e"
|
|
260
260
|
_bins="uv uvx"
|
|
261
261
|
_bins_js_array='"uv","uvx"'
|
|
262
262
|
_libs=""
|
|
@@ -270,7 +270,7 @@ download_binary_and_run_installer() {
|
|
|
270
270
|
_arch="aarch64-unknown-linux-musl-static"
|
|
271
271
|
_zip_ext=".tar.gz"
|
|
272
272
|
_checksum_style="sha256"
|
|
273
|
-
_checksum_value="
|
|
273
|
+
_checksum_value="f6eab0649a3544e687ef5ecacac27130054fbbb53251f9bc97302bd10cd95fbe"
|
|
274
274
|
_bins="uv uvx"
|
|
275
275
|
_bins_js_array='"uv","uvx"'
|
|
276
276
|
_libs=""
|
|
@@ -284,7 +284,7 @@ download_binary_and_run_installer() {
|
|
|
284
284
|
_arch="arm-unknown-linux-musl-staticeabihf"
|
|
285
285
|
_zip_ext=".tar.gz"
|
|
286
286
|
_checksum_style="sha256"
|
|
287
|
-
_checksum_value="
|
|
287
|
+
_checksum_value="d5289e30fe0820bdad5a5fccdf4cc8dcdfe07145b4b96b88ca1c9b2b78f1f180"
|
|
288
288
|
_bins="uv uvx"
|
|
289
289
|
_bins_js_array='"uv","uvx"'
|
|
290
290
|
_libs=""
|
|
@@ -298,7 +298,7 @@ download_binary_and_run_installer() {
|
|
|
298
298
|
_arch="armv7-unknown-linux-gnueabihf"
|
|
299
299
|
_zip_ext=".tar.gz"
|
|
300
300
|
_checksum_style="sha256"
|
|
301
|
-
_checksum_value="
|
|
301
|
+
_checksum_value="bde03eac3f77f3928e684c146c48ba6f5baf815f5cef487144be6f802aec8126"
|
|
302
302
|
_bins="uv uvx"
|
|
303
303
|
_bins_js_array='"uv","uvx"'
|
|
304
304
|
_libs=""
|
|
@@ -312,7 +312,7 @@ download_binary_and_run_installer() {
|
|
|
312
312
|
_arch="armv7-unknown-linux-musl-staticeabihf"
|
|
313
313
|
_zip_ext=".tar.gz"
|
|
314
314
|
_checksum_style="sha256"
|
|
315
|
-
_checksum_value="
|
|
315
|
+
_checksum_value="820cbc56883c917c640178326216501ebc9c758dc2e1f8c67811433ef6a841d8"
|
|
316
316
|
_bins="uv uvx"
|
|
317
317
|
_bins_js_array='"uv","uvx"'
|
|
318
318
|
_libs=""
|
|
@@ -326,7 +326,7 @@ download_binary_and_run_installer() {
|
|
|
326
326
|
_arch="i686-pc-windows-msvc"
|
|
327
327
|
_zip_ext=".zip"
|
|
328
328
|
_checksum_style="sha256"
|
|
329
|
-
_checksum_value="
|
|
329
|
+
_checksum_value="f8be9a4d1ed5bd928eada85dbffe75a8b4acbc080716a8f0e1f492d9e0607c39"
|
|
330
330
|
_bins="uv.exe uvx.exe uvw.exe"
|
|
331
331
|
_bins_js_array='"uv.exe","uvx.exe","uvw.exe"'
|
|
332
332
|
_libs=""
|
|
@@ -340,7 +340,7 @@ download_binary_and_run_installer() {
|
|
|
340
340
|
_arch="i686-unknown-linux-gnu"
|
|
341
341
|
_zip_ext=".tar.gz"
|
|
342
342
|
_checksum_style="sha256"
|
|
343
|
-
_checksum_value="
|
|
343
|
+
_checksum_value="c96b1fc37b938420bd31335f76a9830fd71555360c4300305be1cb74ff907548"
|
|
344
344
|
_bins="uv uvx"
|
|
345
345
|
_bins_js_array='"uv","uvx"'
|
|
346
346
|
_libs=""
|
|
@@ -354,7 +354,7 @@ download_binary_and_run_installer() {
|
|
|
354
354
|
_arch="i686-unknown-linux-musl-static"
|
|
355
355
|
_zip_ext=".tar.gz"
|
|
356
356
|
_checksum_style="sha256"
|
|
357
|
-
_checksum_value="
|
|
357
|
+
_checksum_value="def82722c2c1cbd79894361d1f799a6654d3b1caf4528647420bf3cabb860b20"
|
|
358
358
|
_bins="uv uvx"
|
|
359
359
|
_bins_js_array='"uv","uvx"'
|
|
360
360
|
_libs=""
|
|
@@ -368,7 +368,7 @@ download_binary_and_run_installer() {
|
|
|
368
368
|
_arch="powerpc64le-unknown-linux-gnu"
|
|
369
369
|
_zip_ext=".tar.gz"
|
|
370
370
|
_checksum_style="sha256"
|
|
371
|
-
_checksum_value="
|
|
371
|
+
_checksum_value="dee73aefaac4404812eea61030940cee7ae9a1fe8f2d98fd2bca59832bb64712"
|
|
372
372
|
_bins="uv uvx"
|
|
373
373
|
_bins_js_array='"uv","uvx"'
|
|
374
374
|
_libs=""
|
|
@@ -382,7 +382,7 @@ download_binary_and_run_installer() {
|
|
|
382
382
|
_arch="riscv64gc-unknown-linux-gnu"
|
|
383
383
|
_zip_ext=".tar.gz"
|
|
384
384
|
_checksum_style="sha256"
|
|
385
|
-
_checksum_value="
|
|
385
|
+
_checksum_value="a1ce7e325d0017bc0a83a170695682d0b3eac7483ffbdb970b0da06271e2f1c2"
|
|
386
386
|
_bins="uv uvx"
|
|
387
387
|
_bins_js_array='"uv","uvx"'
|
|
388
388
|
_libs=""
|
|
@@ -396,7 +396,7 @@ download_binary_and_run_installer() {
|
|
|
396
396
|
_arch="riscv64gc-unknown-linux-musl-static"
|
|
397
397
|
_zip_ext=".tar.gz"
|
|
398
398
|
_checksum_style="sha256"
|
|
399
|
-
_checksum_value="
|
|
399
|
+
_checksum_value="0f0d7376b6ccf148342c55473a74d62acfc1f1462e9e601890108b8d6c25e8f9"
|
|
400
400
|
_bins="uv uvx"
|
|
401
401
|
_bins_js_array='"uv","uvx"'
|
|
402
402
|
_libs=""
|
|
@@ -410,7 +410,7 @@ download_binary_and_run_installer() {
|
|
|
410
410
|
_arch="s390x-unknown-linux-gnu"
|
|
411
411
|
_zip_ext=".tar.gz"
|
|
412
412
|
_checksum_style="sha256"
|
|
413
|
-
_checksum_value="
|
|
413
|
+
_checksum_value="3a94361c62ef2b2a6ba6eb72f47aab6589331b8a310fa26ce470053482b33a9e"
|
|
414
414
|
_bins="uv uvx"
|
|
415
415
|
_bins_js_array='"uv","uvx"'
|
|
416
416
|
_libs=""
|
|
@@ -424,7 +424,7 @@ download_binary_and_run_installer() {
|
|
|
424
424
|
_arch="x86_64-apple-darwin"
|
|
425
425
|
_zip_ext=".tar.gz"
|
|
426
426
|
_checksum_style="sha256"
|
|
427
|
-
_checksum_value="
|
|
427
|
+
_checksum_value="3d03adbdd9f943190a6cc21042396d084f5389a2f2fdeea947616ed8f39d90f5"
|
|
428
428
|
_bins="uv uvx"
|
|
429
429
|
_bins_js_array='"uv","uvx"'
|
|
430
430
|
_libs=""
|
|
@@ -438,7 +438,7 @@ download_binary_and_run_installer() {
|
|
|
438
438
|
_arch="x86_64-pc-windows-msvc"
|
|
439
439
|
_zip_ext=".zip"
|
|
440
440
|
_checksum_style="sha256"
|
|
441
|
-
_checksum_value="
|
|
441
|
+
_checksum_value="b656d0fee47bfac6d2656743c74131b248aaadcfa7359fa0b0c05b07d8ed576a"
|
|
442
442
|
_bins="uv.exe uvx.exe uvw.exe"
|
|
443
443
|
_bins_js_array='"uv.exe","uvx.exe","uvw.exe"'
|
|
444
444
|
_libs=""
|
|
@@ -452,7 +452,7 @@ download_binary_and_run_installer() {
|
|
|
452
452
|
_arch="x86_64-unknown-linux-gnu"
|
|
453
453
|
_zip_ext=".tar.gz"
|
|
454
454
|
_checksum_style="sha256"
|
|
455
|
-
_checksum_value="
|
|
455
|
+
_checksum_value="f5721ccf97321af0b405ca7d615a830a332848e3dfb293bcd93e95c829ab37a9"
|
|
456
456
|
_bins="uv uvx"
|
|
457
457
|
_bins_js_array='"uv","uvx"'
|
|
458
458
|
_libs=""
|
|
@@ -466,7 +466,7 @@ download_binary_and_run_installer() {
|
|
|
466
466
|
_arch="x86_64-unknown-linux-musl-static"
|
|
467
467
|
_zip_ext=".tar.gz"
|
|
468
468
|
_checksum_style="sha256"
|
|
469
|
-
_checksum_value="
|
|
469
|
+
_checksum_value="926d1122d4033fc7ff0d710d65430d98fdb2fad1fd527ee7fb78ad244910a271"
|
|
470
470
|
_bins="uv uvx"
|
|
471
471
|
_bins_js_array='"uv","uvx"'
|
|
472
472
|
_libs=""
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
[[resources]]
|
|
2
|
-
# name is one of:
|
|
3
|
-
# + global_resource_id, defined in cider.access-ci.org
|
|
4
|
-
# + global_group_id, defined in
|
|
5
|
-
# https://operations-api.access-ci.org/wh2/cider/v1/access-active-groups/
|
|
6
|
-
# Required? YES
|
|
7
|
-
# Data type: string
|
|
8
|
-
name =
|
|
9
|
-
|
|
10
|
-
# type is one of: "global_resource_id", "global_group_id"
|
|
11
|
-
# it is essentially telling where the "name" (above) came from
|
|
12
|
-
# Required? YES
|
|
13
|
-
# Data type: string
|
|
14
|
-
type =
|
|
15
|
-
|
|
16
|
-
# Specify a custom module path to use instead of MODULEPATH environment variable
|
|
17
|
-
# [OPTIONAL] string: same format and purpose of MODULEPATH
|
|
18
|
-
# Required? No (defaults to MODULEPATH environment variable)
|
|
19
|
-
# Data type: string
|
|
20
|
-
modulepath =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# Can specify this multiple times
|
|
24
|
-
# data for each unique resource_id OR group_id will be published in turn
|
|
25
|
-
#[[resources]]
|
|
26
|
-
#name =
|
|
27
|
-
#type =
|
|
28
|
-
#modulepath =
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
import importlib
|
|
3
|
-
import json
|
|
4
|
-
# import requests
|
|
5
|
-
import time
|
|
6
|
-
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
from textwrap import dedent
|
|
9
|
-
|
|
10
|
-
import lmod_toolkit as lmtk
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__all__ = [
|
|
14
|
-
'get_resource_data',
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
data_functions = [
|
|
18
|
-
'lmod_spider',
|
|
19
|
-
'lmod_ext_attrs',
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def go():
|
|
24
|
-
lmtk_metadata = lmtk.metadata.as_dict()
|
|
25
|
-
lmod_config_data = lmtk.lmod_config.as_dict()
|
|
26
|
-
for resource_definition in lmtk.config.iter_resources():
|
|
27
|
-
for pymod_name in data_functions:
|
|
28
|
-
pymod = importlib.import_module( f"lmod_toolkit.{pymod_name}" )
|
|
29
|
-
data_to_publish = {
|
|
30
|
-
'resource': resource_definition,
|
|
31
|
-
'lmod_toolkit': lmtk.metadata.as_dict(),
|
|
32
|
-
'manifest': { 'data_type': pymod_name },
|
|
33
|
-
'payload': pymod.as_dict(),
|
|
34
|
-
}
|
|
35
|
-
publish_data( data=data_to_publish, datatype=pymod_name )
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def publish_data( data: dict, datatype: string ) -> None:
|
|
39
|
-
filepath = write_to_local_file( data=data, datatype=datatype )
|
|
40
|
-
# upload_http( data )
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def write_to_local_file( data: dict, datatype: string ) -> Path:
|
|
44
|
-
# make output filename
|
|
45
|
-
ts = int( time.time() )
|
|
46
|
-
timestamp = datetime.datetime.fromtimestamp( ts, tz=datetime.timezone.utc )
|
|
47
|
-
fn_suffix = timestamp.strftime( '%F_%T%z' )
|
|
48
|
-
outfile = lmtk.metadata.data_dir / f"{datatype}.{fn_suffix}"
|
|
49
|
-
|
|
50
|
-
# write data
|
|
51
|
-
with outfile.open( mode='w', encoding='utf-8' ) as fh:
|
|
52
|
-
json.dump( data, fh, default=str )
|
|
53
|
-
|
|
54
|
-
return outfile
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def upload_http( filename: Path ) -> None:
|
|
58
|
-
''' Upload file data to a web API via HTTP.
|
|
59
|
-
See also: https://github.com/andylytical/jira-tools/blob/main/web_api.py
|
|
60
|
-
'''
|
|
61
|
-
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|