Skip to content

Commit

Permalink
* added module "docker.template" to support adaptive CK containers
Browse files Browse the repository at this point in the history
* added rebuild function to module:docker to rebuild images (#145)
* added support for multiple Docker tags in module:docker
  See example: https://github.com/octoml/mlops/tree/main/docker/ck-template-mlperf
* added "default_org" key in Docker image to specify default organization
* added "outdated" and "aging" keys in Docker images to warn user
  about a status of a given Docker image
* added main CK and MLPerf repositories to Zenodo
  to ensure reproducibilty
* added common function "tested" to mark CK entries as tested,
  i.e. "ck tested docker:mlperf-inference-v0.7.openvino"
  • Loading branch information
gfursin committed May 24, 2021
1 parent ee48cfe commit b25d0e8
Show file tree
Hide file tree
Showing 21 changed files with 305 additions and 26 deletions.
16 changes: 15 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
* V2.2.0.1
* V2.4.0
* added module "docker.template" to support adaptive CK containers
* added rebuild function to module:docker to rebuild images (#145)
* added support for multiple Docker tags in module:docker
See example: https://github.com/octoml/mlops/tree/main/docker/ck-template-mlperf
* added "default_org" key in Docker image to specify default organization
* added "outdated" and "aging" keys in Docker images to warn user
about a status of a given Docker image
* added main CK and MLPerf repositories to Zenodo
to ensure reproducibilty
* added common function "tested" to mark CK entries as tested,
i.e. "ck tested docker:mlperf-inference-v0.7.openvino"

* V2.3.0
* improved "ck search" to search tags in entries with inheritance
* fixed function "ck status"

* V2.2.0
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Linux/MacOS: [![Build Status](https://travis-ci.org/ctuning/ck.svg?branch=master)](https://travis-ci.org/ctuning/ck)
Windows: [![Windows Build status](https://ci.appveyor.com/api/projects/status/iw2k4eajy54xrvqc?svg=true)](https://ci.appveyor.com/project/gfursin/ck)

[![DOI](https://zenodo.org/badge/26230485.svg)](https://zenodo.org/badge/latestdoi/26230485)
[![Documentation Status](https://readthedocs.org/projects/ck/badge/?version=latest)](https://ck.readthedocs.io/en/latest/?badge=latest)
[![Coverage Status](https://coveralls.io/repos/github/ctuning/ck/badge.svg)](https://coveralls.io/github/ctuning/ck)

Expand Down
82 changes: 81 additions & 1 deletion ck/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


# We use 3 digits for the main (released) version and 4th digit for development revision
__version__ = "2.3.0"
__version__ = "2.4.0"
# Do not use characters (to detect outdated version)!

# Import packages that are global for the whole kernel
Expand Down Expand Up @@ -300,6 +300,8 @@

"download": {"desc": "<CID> attempt to download entry from remote host (experimental)", "for_web": "yes"},

"tested": {"desc": "<CID> mark CK component as tested", "for_web": "no"},

"print_input": {"desc": "prints input"},

},
Expand Down Expand Up @@ -336,6 +338,7 @@
"delete_index",
"get_api",
"download",
"tested",
"convert_cm_to_ck"]
}

Expand Down Expand Up @@ -3262,6 +3265,83 @@ def download(i):

return {'return': 0}

##############################################################################
# Mark a given CK component as tested
#
# TARGET: end users


def tested(i):
"""Mark a given CK component as tested
Target audience: end users
Args:
(repo_uoa) (str): CK repo UOA
(module_uoa) (str): CK module UOA
(data_uoa) (str): CK data UOA
(name) (str): name of a tester
(email) (str): email of a tester
Returns:
return (int): return code = 0, if successful
> 0, if error
(error) (str): error text if return > 0
"""

o = i.get('out', '')

ruoa = i.get('repo_uoa', '')
muoa = i.get('module_uoa', '')
duoa = i.get('data_uoa', '')

name = i.get('name','')
if name == '':
name = cfg.get('default_developer', '')

email = i.get('email','')
if email == '':
email = cfg.get('default_developer_email', '')

# Load entry
r=access({'action':'load',
'repo_uoa':ruoa,
'module_uoa':muoa,
'data_uoa':duoa})
if r['return']>0: return r

d=r['dict']

tested=d.get('tested',[])

pack={'name':name,
'email':email}

rdt = get_current_date_time({})
pack['iso_datetime'] = rdt['iso_datetime']

tested.append(pack)

d['tested'] = tested

# Update entry
r=access({'action':'update',
'repo_uoa':ruoa,
'module_uoa':muoa,
'data_uoa':duoa,
'dict':d,
'sort_keys':'yes',
'ignore_update':'yes'})
if r['return']>0: return r

if o=='con':
out('Entry updated successfully!')

return r


##############################################################################
# Reload cache with meta-descriptions of all CK repos
#
Expand Down
1 change: 1 addition & 0 deletions ck/repo/module/.cm/alias-a-docker.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
619e141969aa4bad
1 change: 1 addition & 0 deletions ck/repo/module/.cm/alias-u-619e141969aa4bad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker.template
1 change: 1 addition & 0 deletions ck/repo/module/docker.template/.cm/desc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
20 changes: 20 additions & 0 deletions ck/repo/module/docker.template/.cm/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"backup_data_uid": "619e141969aa4bad",
"backup_module_uid": "032630d041b4fd8a",
"backup_module_uoa": "module",
"control": {
"author": "Grigori Fursin",
"author_email": "[email protected]",
"author_webpage": "http://fursin.net",
"copyright": "See CK COPYRIGHT.txt for copyright details",
"engine": "CK",
"iso_datetime": "2021-05-23T16:28:50.758788",
"license": "See CK LICENSE.txt for licensing details",
"version": [
"2",
"2",
"0"
]
},
"data_name": "docker.template"
}
9 changes: 9 additions & 0 deletions ck/repo/module/docker.template/.cm/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"actions": {},
"copyright": "See CK COPYRIGHT.txt for copyright details",
"desc": "Docker template",
"developer": "Grigori Fursin",
"developer_email": "[email protected]",
"developer_webpage": "http://fursin.net",
"license": "See CK LICENSE.txt for licensing details"
}
32 changes: 32 additions & 0 deletions ck/repo/module/docker.template/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Collective Knowledge (Docker template)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
##
# Developer: Grigori Fursin, [email protected], http://fursin.net
#

cfg = {} # Will be updated by CK (meta description of this module)
work = {} # Will be updated by CK (temporal data)
ck = None # Will be updated by CK (initialized CK kernel)

# Local settings

##############################################################################
# Initialize module


def init(i):
"""
Input: {}
Output: {
return - return code = 0, if successful
> 0, if error
(error) - error text if return > 0
}
"""
return {'return': 0}
3 changes: 3 additions & 0 deletions ck/repo/module/docker/.cm/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"push": {
"desc": "push a given image to the Docker Hub"
},
"rebuild": {
"desc": "rebuild a given container"
},
"run": {
"desc": "run Docker image"
},
Expand Down
14 changes: 14 additions & 0 deletions ck/repo/module/docker/.cm/updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@
"4",
"1"
]
},
{
"author": "Grigori Fursin",
"author_email": "[email protected]",
"author_webpage": "http://fursin.net",
"copyright": "See CK COPYRIGHT.txt for copyright details",
"engine": "CK",
"iso_datetime": "2021-05-24T09:03:30.724920",
"license": "See CK LICENSE.txt for licensing details",
"version": [
"2",
"2",
"0"
]
}
]
}
Loading

0 comments on commit b25d0e8

Please sign in to comment.