Skip to content

Commit

Permalink
fixed cmx init (#1306)
Browse files Browse the repository at this point in the history
Ref: #1305
  • Loading branch information
ctuning-admin authored Oct 8, 2024
2 parents 052f17b + decac5d commit 1719778
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
3 changes: 3 additions & 0 deletions cm/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## V3.0.2
- fixed cmx init

## V3.0.1
- fixed minor bug in CM core

Expand Down
2 changes: 1 addition & 1 deletion cm/cmind/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Written by Grigori Fursin

__version__ = "3.0.1"
__version__ = "3.0.2"

from cmind.core import access
from cmind.core import x
Expand Down
17 changes: 14 additions & 3 deletions cm/cmind/repo/automation/core/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,26 @@
class CMInit():
###############################################################
def run(self, quiet = False, skip = False, repo_name = 'mlcommons@cm4mlops', repo_url = '',
repo_branch = '', repo_checkout = ''):
repo_branch = '', repo_checkout = '', x_was_called = False):
import cmind

print ('Checking platform information ...')
self.get_sys_platform()

print ('[SUCCESS]')

print ('')
print ('Checking system dependencies ...')
r = self.install_system_packages(quiet)
if r['return']>0 or r.get('warning','') !='' :
return r

print ('[SUCCESS]')

rr = {'return':0}

if not skip:
# Do not pull extra repositories in CMX
if not skip and not x_was_called:

print ('')
print ('Pulling default automation repository ...')
Expand Down Expand Up @@ -259,12 +264,18 @@ def init(self, i):
repo_branch = i.get('branch', '')
repo_checkout = i.get('checkout', '')

# Check if X was called
x_was_called = False
if hasattr(self.cmind, 'x_was_called'):
x_was_called = self.cmind.x_was_called

r = cm_init.run(quiet = quiet,
skip = skip,
repo_name = repo_name,
repo_url = repo_url,
repo_branch = repo_branch,
repo_checkout = repo_checkout)
repo_checkout = repo_checkout,
x_was_called = x_was_called)
if r['return']>0: return r

warning = r.get('warning', '')
Expand Down
10 changes: 6 additions & 4 deletions cm/docs/cmx/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sudo apt install python3 python3-pip python3-venv git git-lfs wget curl
python3 -m venv cm
source cm/bin/activate

python3 -m pip install cmind
pip install cmind
```

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

You can check that CMX works using the following command:
You can now check that all system dependencies are installed using the following command:
```bash
cmx init
```
You can also check that CMX core works using the following command:
```bash
cmx test core
```



## Red Hat

*We have successfully tested CM on Red Hat 9 and CentOS 8*
Expand Down
1 change: 1 addition & 0 deletions cm/setup_install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip install .

0 comments on commit 1719778

Please sign in to comment.