Skip to content

Commit 1719778

Browse files
fixed cmx init (#1306)
Ref: #1305
2 parents 052f17b + decac5d commit 1719778

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

cm/CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## V3.0.2
2+
- fixed cmx init
3+
14
## V3.0.1
25
- fixed minor bug in CM core
36

cm/cmind/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Written by Grigori Fursin
44

5-
__version__ = "3.0.1"
5+
__version__ = "3.0.2"
66

77
from cmind.core import access
88
from cmind.core import x

cm/cmind/repo/automation/core/module.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,26 @@
1616
class CMInit():
1717
###############################################################
1818
def run(self, quiet = False, skip = False, repo_name = 'mlcommons@cm4mlops', repo_url = '',
19-
repo_branch = '', repo_checkout = ''):
19+
repo_branch = '', repo_checkout = '', x_was_called = False):
2020
import cmind
2121

2222
print ('Checking platform information ...')
2323
self.get_sys_platform()
2424

25+
print ('[SUCCESS]')
26+
2527
print ('')
2628
print ('Checking system dependencies ...')
2729
r = self.install_system_packages(quiet)
2830
if r['return']>0 or r.get('warning','') !='' :
2931
return r
3032

33+
print ('[SUCCESS]')
34+
3135
rr = {'return':0}
3236

33-
if not skip:
37+
# Do not pull extra repositories in CMX
38+
if not skip and not x_was_called:
3439

3540
print ('')
3641
print ('Pulling default automation repository ...')
@@ -259,12 +264,18 @@ def init(self, i):
259264
repo_branch = i.get('branch', '')
260265
repo_checkout = i.get('checkout', '')
261266

267+
# Check if X was called
268+
x_was_called = False
269+
if hasattr(self.cmind, 'x_was_called'):
270+
x_was_called = self.cmind.x_was_called
271+
262272
r = cm_init.run(quiet = quiet,
263273
skip = skip,
264274
repo_name = repo_name,
265275
repo_url = repo_url,
266276
repo_branch = repo_branch,
267-
repo_checkout = repo_checkout)
277+
repo_checkout = repo_checkout,
278+
x_was_called = x_was_called)
268279
if r['return']>0: return r
269280

270281
warning = r.get('warning', '')

cm/docs/cmx/install.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ sudo apt install python3 python3-pip python3-venv git git-lfs wget curl
2222
python3 -m venv cm
2323
source cm/bin/activate
2424

25-
python3 -m pip install cmind
25+
pip install cmind
2626
```
2727

2828
Note that you may need to restart your shell to update PATH to the "cmx" binary.
@@ -33,13 +33,15 @@ Alternatively you can run
3333
source $HOME/.profile
3434
```
3535

36-
You can check that CMX works using the following command:
36+
You can now check that all system dependencies are installed using the following command:
37+
```bash
38+
cmx init
39+
```
40+
You can also check that CMX core works using the following command:
3741
```bash
3842
cmx test core
3943
```
4044

41-
42-
4345
## Red Hat
4446

4547
*We have successfully tested CM on Red Hat 9 and CentOS 8*

cm/setup_install.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip install .

0 commit comments

Comments
 (0)