Skip to content

Commit

Permalink
added installation info to support long paths in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed Feb 24, 2024
1 parent 801e89f commit 4982cc2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 38 deletions.
4 changes: 3 additions & 1 deletion cm-mlops/script/gui/install/windows.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
* Download and install Git from [git-for-windows.github.io](https://git-for-windows.github.io).
* Configure Windows 10+ to support long paths as described
[here](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later).
* Download and install Git from [git-for-windows.github.io](https://git-for-windows.github.io).
* Configure Git to accept long file names: `git config --system core.longpaths true`
* Download and install Python 3+ from [www.python.org/downloads/windows](https://www.python.org/downloads/windows).
* Don't forget to select option to add Python binaries to PATH environment!
Expand Down
13 changes: 9 additions & 4 deletions cm-mlops/script/gui/playground_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def page(st, params, extra):

url_prefix = st.config.get_option('server.baseUrlPath')+'/'

if not extra.get('skip_header',False):
if not extra.get('skip_header', False):
st.markdown('---')
st.markdown('**Install [MLCommons Collective Mind automation framework](https://github.com/mlcommons/ck):**')

Expand All @@ -26,11 +26,16 @@ def page(st, params, extra):
('MacOS', 'macos'),
('Windows', 'windows')]

host_os_selection = 0

if extra.get('run_on_windows', False):
host_os_selection = 3

host_os = st.selectbox('Select your host OS:',
range(len(choices)),
format_func = lambda x: choices[x][0],
index=0,
key='select_host_os')
index = host_os_selection,
key = 'install_select_host_os')

host_os_index = choices[host_os][1]

Expand Down Expand Up @@ -86,7 +91,7 @@ def page(st, params, extra):
x = '{} -m pip install cmind -U{}\n\n'.format(python, need_user)
x += 'cm pull repo {}\n\n'.format(cm_repo)

clean_cm_cache = st.toggle('Clean CM cache', value=True)
clean_cm_cache = st.toggle('Clean CM cache', value=True, key = 'install_clean_cm_cache')

cm_clean_cache = 'cm rm cache -f\n\n' if clean_cm_cache else ''

Expand Down
40 changes: 7 additions & 33 deletions cm-mlops/script/gui/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,41 +325,15 @@ def page(i):

if show_cm_install:

use_dev_repo = st.toggle('Use the [latest automation recipes](https://access.cknowledge.org/playground/?action=scripts)', value=True)
cm_repo = 'ctuning@mlcommons-ck' if use_dev_repo else 'mlcommons@ck'
import playground_install
extra = {'skip_header': True,
'run_on_windows': host_os_use_windows}
r = playground_install.page(st, params, extra)
if r['return']>0: return r

clean_cm_cache = st.toggle('Clean CM cache', value=True)
cm_clean_cache = 'cm rm cache -f\n' if clean_cm_cache else ''

x = 'pip install cmind -U\n\ncm pull repo {}\n\n{}'.format(cm_repo, cm_clean_cache)

# Hack to detect python virtual environment and version
python_venv_name=st_inputs.get('@adr.python.name', '')
python_ver=st_inputs.get('@adr.python.version', '')
python_ver_min=st_inputs.get('@adr.python.version_min', '')

y = ''
if python_venv_name!='':# or python_ver!='' or python_ver_min!='':
y = '\ncm run script "get sys-utils-cm"\n'

if python_venv_name!='':
y+='cm run script "install python-venv" --name='+str(python_venv_name)
else:
y+='cm run script "get python"'

if python_ver!='':
y+=' --version='+str(python_ver)

if python_ver_min!='':
y+=' --version_min='+str(python_ver_min)

if y!='':
x+=y


st.markdown('```bash\n{}\n```\n'.format(x))

st.markdown('---')

st.markdown('Check [full installation guide](https://github.com/mlcommons/ck/blob/master/docs/installation.md) with dependencies for Linux, Windows, MacOS, RHEL, etc')


############################################################################
Expand Down
2 changes: 2 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ python3 -m pip install cmind

## Windows

* Configure Windows 10+ to support long paths as described
[here](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later).
* Download and install Git from [git-for-windows.github.io](https://git-for-windows.github.io).
* Configure Git to accept long file names: `git config --system core.longpaths true`
* Download and install Python 3+ from [www.python.org/downloads/windows](https://www.python.org/downloads/windows).
Expand Down

0 comments on commit 4982cc2

Please sign in to comment.