Тимур Сафин
Новый InterSystems:
open-source,
митапы,
хакатоны
• Apache
• Eclipse(Atelier)
• Linux, gnu tools like gcc, gdb &
friends
• Python, Perl
• Ant/maven/gradle
• Hibernate
• iODBC/unixODBC (ODBC
Managers)
• Browsers: Firefox + Chrome
• Enterprise Framework(EF)
• JS libs (jQuery,….)
• Docker (docker scripts for
provisioning, etc.)
• …
Open-Source в InterSystems
• Проект Atelier делает многое по новому
–Open-source Eclipse-based окружение
–Работа с внешними контрибьютерами через GitHub
–Code review, Continuous Integration, всё по-модному
–Облачное тестирование через Docker
–Исходники Atelier будут опубликованы*
InterSystems меняется
* Скорее всего. Таковы текущие планы
• InterSystems уже на GitHub
*Пока нет легкого способа найти исходники Caché
ObjectScript на GitHub
Open source сообщество
Hub # of forks # of repos
Intersystems-ru 46 48
Intersystems 29 4
Intersystems-ib 1 5
• Reincarnation of MUGs
• Local. No remote commuting is needed
• After-hours, typically since 6-7PM
• 2 presentations is ideal (more is acceptable)
• Ideally should be:
–driven by local community members
–Topics from community, not ISC only
–hosted at partners’ territory
• The cheaper - the better!
Meetups
Meetups
• 1st InterSystems hackathon
• 10 proposed ideas
• 7 teams formed and started
• 4 remarkable results
Hackathon
http://writeimagejournal.com/?p=1912
• [Yet another] JavaScript ODM for Caché
https://github.com/ZitRos/cjs
•Nikita Savchenko (GitHub @ZitRos)
•Anton Gnibeda (GitHub @Gnibeda)
•Irene Mikhailova (GitHub @Gra-ach)
Hackathon: 1st place
http://writeimagejournal.com/?p=1912
http://writeimagejournal.com/?p=1912
cjs.connector.connect("http://172.16.2.172:57776/", "Samples", ["School2015"],
function (cache) {
var p = new cache.School2015.Participant();
p.Name = "Anton";
p.Surname = "Gnibeda";
p.$save(function(obj) {
console.log("Participant with name " + obj.name + " saved!");
});
cache.School2015.Group.openById(1, function (group) {
console.log("Points: " + group.Points);
});
cache.School2015.Group.AddPoints(1, 1);
cache.School2015.Group.openById(1, function (group) {
group.PrintInfo(function (res) {
console.log(res);
});
});
cache.School2015.Participant
.query()
• Spatial indices in Caché -
https://github.com/intersystems-ru/spatialindex
•Andrey Rechitsky (GitHub @arechitsky)
•Alexander Koblov (GitHub @adaptun)
•Alexander Pogrebnikov (GitHub @apogrebnikov)
Hackathon: 2nd place
http://writeimagejournal.com/?p=1912
Index x1f on (Latitude,Longitude) As SpatialIndex.Index;
Then you can query table with defined index.
2 types of queries implemented: window (rectangle) and radius (ellipse).
SELECT *
FROM SpatialIndex.Test
WHERE %ID %FIND search_index(x1F,'window','minx=56,miny=56,maxx=57,maxy=57')
SELECT *
FROM SpatialIndex.Test
WHERE %ID %FIND search_index(x1F,'radius','x=55,y=55,radius=2')
and name %StartsWith 'Z'
SELECT *
FROM SpatialIndex.Test
WHERE %ID %FIND search_index(x1F,'radius','x=55,y=55,radiusX=2,radiusY=2')
and name %StartsWith 'Z'
Hackathon: 3rd place
• Call graph visualization
https://github.com/intersystems-ru/callsmap
•Oleg Dmitrovich (GitHub @doublefint)
•Evgenia Litvin
•Alexander Tsvetkov (GitHub @TsvetkovAV)
• Visualizes call dependencies graph
http://writeimagejournal.com/?p=1912
• Database Blocks Explorer for InterSystems Caché -
https://github.com/intersystems-ru/CacheBlocksExplorer
•Dmitry Maslennikov (GitHub @daimor)
•Olga Kazantseva
• Visualizes global B*-tree structure and allocation map
Hackathon: 3rd place
http://writeimagejournal.com/?p=1912
CacheBlocksExplorer – B*-tree
CacheBlocksExplorer – blocks map
This always starts with the people
doublefint
gnibeda
ZitRos
daimor
Package Manager
http://cpmteam.github.io/CPM/
do ^CPM
cpm install webterminal
We have full cycle in
CPM
(publish – install)
Where we are today?
Create/
modify
package
Export
XML/JSON
to staging
area
npm
publish to
repo
Package
search in
repo
Install
package
from repo
Creating Caché Package Manager
Implementation Update
• Which container format is the suitable for our packages?
– ZIP would be ideal
– But even Studio Project XML will fit the purpose
• even now it handles all interesting file types (CLS, RTN, INC, CSP, ZEN, CSS, GIF, etc.)
• Yes, XML is very inefficient, bloated, and keeps binary data as base64
(i.e. 3/2x length increase)
• But it’s not a big deal for initial step;
Container Format
Plans – December 2014
Which
Container?
ZIP
XML
Plans – December 2014
• What information should be in metadata?
– At least dependency on other packages (name, version, url);
– Anything from Node.js package.json could be reused by us, but;
• JSON is not yet natively supported now,
so could start from XML serialization of the same information (metainfo.xml)
Metadata File
{ "dependencies" :
{ "foo" : "1.0.0 - 2.9999.9999"
, "bar" : ">=1.0.2 <2.1.2"
, "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0"
, "asd" : "http://asdf.com/asdf.tar.gz"
, "til" : "~1.2"
, "elf" : "~1.2.3"
, "lat" : "latest"
, "dyl" : "file:../dyl"
}
}
Reality – March 2015
• We decided to use npm services for publishing to the server;
• It accepts package.json as metadata description;
• npm packs generated XML file to the .TGZ container which is being published to the
repo;
Container and metadata formats
export /minor
package
CPM
package/package.json
package/package.xml
package/package.tgz
NPM
/-/all/ - JSON index
CouchDB
Plans – December 2014
• There is tough problem to handle – dependency on a system packages which may be
presented only on some product flavors:
– iKnow,
– Ensemble
– DeepSee,
– TrakCare,
– HealthShare,
– particular version of product
• May mark this dependency in the general dependency list as “iKnow”, “Ensemble
2013.1+”, etc.
• But it’s too early to handle in the 1st iteration - we will revisit this later.
Dependency on a system classes
Dependencies
Not in V0.1
Reality – March 2015
Plans – December 2014
• From the practical prospective, taking into account
multiple Caché platforms we should handle equally well
(Windows, Linux, Mac OS X, or even VMS), and the fact
that these FFI mechanisms are not yet officially
supported, we should admit that they are not ready yet,
and could not be recommended as a way to handle
deploymenut of mixed C/COS packages.
• We are not implementing them in v1.0
[Cross-platform] binary modules
Not in V0.1
Reality – March 2015
[Cross-platform] binary modules
Plans – December 2014
• Having built-in mechanism for unit-testing has impacted
positively the whole stability of CPAN ecosystem.
–Package will not be installed at the user system unless it’s
passing internal testing;
• V1.0 will ignore unit-testing for a moment, but later, for binary
modules deployment we should have unit-testing working
Unit-testing
Unit-testing
Not in V0.1
Reality – March 2015
Plans – December 2014
• User experience is a big success booster, if system is inconvenient then it may be left
unnoticed*
• So both ways to invoke package manager should be working
– To invoke package manager shell from any namespace in Cache’ terminal, .e.g
– To install COS packages from command-line, e.g.
• Eventually these operation might be wrapped in GUI. Not in V1.0
Command-line access
do ^%CPM
>install TOML-Parser
cpm install deepsee-mobile-server
• Command-line wrapper created
for Windows cpm.bat,
which invokes default Caché
instance with the command-line
options entered;
• Only single running instance
handled today;
Command-line access
Reality – March 2015
C:UsersTimurDocumentsIntersystemssrcCPMbin>cpm list
cpm-installer-sample 0.5.2
simple-proj 0.4.2
C:UsersTimurDocumentsIntersystemssrcCPMbin>cpm list /verbose
cpm-installer-sample 0.5.2
Sample.Address.cls
Sample.Company.cls
Sample.Customer.cls
Sample.Employee.cls
Sample.Person.cls
Sample.USZipCode.cls
Sample.Utils.cls
Sample.Vendor.cls
simple.prj
simple-proj 0.4.2
Sample.Address.CLS
Sample.Company.CLS
Sample.Customer.CLS
Sample.Employee.CLS
Sample.Person.CLS
Plans – December 2014
• There used to be old-dark times when every site had to handle DDoS on
their own way, and to keep geo-spread mirror network for their purposes;
• Now all is easily handled by VM host providers or special CDN providers:
– Amazon Azure, Google Cloud, etc;
– Amazon CloudFront, MaxCDN, etc;
• Once we have static files (distributions files, static html descriptions, static
images, etc) it could be easily handled by CDN;
• But… for community site we supposed to have some dynamic part which
will work with authors and new contributions
Advices are welcome how to handle this mix easily and in most effective way
Mirroring and CDN
Reality – March 2015
• We have selected CouchDB database hosting for keeping
packages metadata and their content;
• CouchDB is the JSON database store accessible via full RESTful
API;
• Same/similar database store is used for keeping NPM.js
repository;
–Thus we could use npm command-line utility for operations
with this store if repository redefined to ours;
Mirroring and CDN CouchDB repository
CouchDB repository
Reality – March 2015
Plans – December 2014
Suggested usage cases for V1.0
Package User COS System COS Binaries Good for v1.0
iKnowSocial Yes No No Good
Atom-COS-Studio Yes Yes Yes
(Atom +
extension)
Bad
WebTerminal No Yes No Good
CNA Yes No Yes
(callout module)
Bad
Coslint Yes
(deployed OBJ
code)
No No Probably
(deployed)
Actual usage cases for V0.1
Reality – March 2015
Package User COS System COS
Cache-tort-git Yes Yes
iKnowSocial Yes No
Monlbl-viewer Yes No
WebTerminal Yes Yes
Simple-proj Yes No
Cpm-installer-sample Yes No
• Help, H, ?
• Quit, Q
CPM Shell Commands
• List, L
CPM Shell Commands
• List /verbose
CPM Shell Commands
• Install, I
–From repo
–From local file(s)
CPM Shell Commands
• Package, P
–/create /from
–/description
–/author
CPM Shell Commands
CPM:CPM>> package /create cache-tort-git /author adaptun
/from pathtocache-tort-git
Load of directory started on 03/16/2015 15:11:45
Loading file C:UsersTimurDocumentsGitHubcache-tort-gitcache-tort-git.prj…
Imported project: cache-tort-git.prj
Loading file C:UsersTimurDocumentsGitHubcache-tort-git%SourceControlGit…
Imported class: %SourceControl.Git
Loading file C:UsersTimurDocumentsGitHubcache-tort-git%SourceControlGit…
Imported class: %SourceControl.Git.Utils
Loading file C:UsersTimurDocumentsGitHubcache-tort-gitcspgitprojectset…
Imported CSP/CSR or file: csp/cpm/gitprojectsettings.csp
Compilation started on 03/16/2015 15:11:46 with qualifiers 'ck',
compiling 2 classes, using 4 worker jobs
Compiling class %SourceControl.Git.Utils
Compiling class %SourceControl.Git
• Export, E
–/minor
–/major
CPM Shell Commands
CPM:CPM>> export /major cache-tort-git
cache-tort-git version set to: 0.1.1
Exporting package files to: C:InterSystemsCacheLatest.cpmcache-
tort-git
Deleted all files in the directory:
Exporting to XML started on 03/16/2015 15:12:04
Exporting class: %SourceControl.Git.Utils
Exporting class: %SourceControl.Git
Exporting project: cache-tort-git.prj
Exporting CSP/CSR or file: /csp/cpm/gitprojectsettings.csp
Export finished successfully.
• Npm publish
Command-Line
C:InterSystemsCacheLatest.cpmcache-tort-git>npm publish
--registry http://cpmiscregistry.couchappy.com
+ cache-tort-git@0.1.1
• Every respected repository has good name and an
appropriate avatar;
• We will appreciate any suggestion about CPM URL name and
avatar!
Name and avatar suggestions
Package Manager
http://cpmteam.github.io/CPM/
do ^CPM
cpm install webterminal

Новый InterSystems: open-source, митапы, хакатоны

  • 1.
  • 2.
    • Apache • Eclipse(Atelier) •Linux, gnu tools like gcc, gdb & friends • Python, Perl • Ant/maven/gradle • Hibernate • iODBC/unixODBC (ODBC Managers) • Browsers: Firefox + Chrome • Enterprise Framework(EF) • JS libs (jQuery,….) • Docker (docker scripts for provisioning, etc.) • … Open-Source в InterSystems
  • 3.
    • Проект Atelierделает многое по новому –Open-source Eclipse-based окружение –Работа с внешними контрибьютерами через GitHub –Code review, Continuous Integration, всё по-модному –Облачное тестирование через Docker –Исходники Atelier будут опубликованы* InterSystems меняется * Скорее всего. Таковы текущие планы
  • 4.
    • InterSystems ужена GitHub *Пока нет легкого способа найти исходники Caché ObjectScript на GitHub Open source сообщество Hub # of forks # of repos Intersystems-ru 46 48 Intersystems 29 4 Intersystems-ib 1 5
  • 5.
    • Reincarnation ofMUGs • Local. No remote commuting is needed • After-hours, typically since 6-7PM • 2 presentations is ideal (more is acceptable) • Ideally should be: –driven by local community members –Topics from community, not ISC only –hosted at partners’ territory • The cheaper - the better! Meetups
  • 6.
  • 7.
    • 1st InterSystemshackathon • 10 proposed ideas • 7 teams formed and started • 4 remarkable results Hackathon http://writeimagejournal.com/?p=1912
  • 8.
    • [Yet another]JavaScript ODM for Caché https://github.com/ZitRos/cjs •Nikita Savchenko (GitHub @ZitRos) •Anton Gnibeda (GitHub @Gnibeda) •Irene Mikhailova (GitHub @Gra-ach) Hackathon: 1st place http://writeimagejournal.com/?p=1912
  • 9.
    http://writeimagejournal.com/?p=1912 cjs.connector.connect("http://172.16.2.172:57776/", "Samples", ["School2015"], function(cache) { var p = new cache.School2015.Participant(); p.Name = "Anton"; p.Surname = "Gnibeda"; p.$save(function(obj) { console.log("Participant with name " + obj.name + " saved!"); }); cache.School2015.Group.openById(1, function (group) { console.log("Points: " + group.Points); }); cache.School2015.Group.AddPoints(1, 1); cache.School2015.Group.openById(1, function (group) { group.PrintInfo(function (res) { console.log(res); }); }); cache.School2015.Participant .query()
  • 10.
    • Spatial indicesin Caché - https://github.com/intersystems-ru/spatialindex •Andrey Rechitsky (GitHub @arechitsky) •Alexander Koblov (GitHub @adaptun) •Alexander Pogrebnikov (GitHub @apogrebnikov) Hackathon: 2nd place http://writeimagejournal.com/?p=1912
  • 11.
    Index x1f on(Latitude,Longitude) As SpatialIndex.Index; Then you can query table with defined index. 2 types of queries implemented: window (rectangle) and radius (ellipse). SELECT * FROM SpatialIndex.Test WHERE %ID %FIND search_index(x1F,'window','minx=56,miny=56,maxx=57,maxy=57') SELECT * FROM SpatialIndex.Test WHERE %ID %FIND search_index(x1F,'radius','x=55,y=55,radius=2') and name %StartsWith 'Z' SELECT * FROM SpatialIndex.Test WHERE %ID %FIND search_index(x1F,'radius','x=55,y=55,radiusX=2,radiusY=2') and name %StartsWith 'Z'
  • 12.
    Hackathon: 3rd place •Call graph visualization https://github.com/intersystems-ru/callsmap •Oleg Dmitrovich (GitHub @doublefint) •Evgenia Litvin •Alexander Tsvetkov (GitHub @TsvetkovAV) • Visualizes call dependencies graph http://writeimagejournal.com/?p=1912
  • 13.
    • Database BlocksExplorer for InterSystems Caché - https://github.com/intersystems-ru/CacheBlocksExplorer •Dmitry Maslennikov (GitHub @daimor) •Olga Kazantseva • Visualizes global B*-tree structure and allocation map Hackathon: 3rd place http://writeimagejournal.com/?p=1912
  • 14.
  • 15.
  • 16.
    This always startswith the people doublefint gnibeda ZitRos daimor
  • 17.
  • 18.
    We have fullcycle in CPM (publish – install) Where we are today? Create/ modify package Export XML/JSON to staging area npm publish to repo Package search in repo Install package from repo
  • 19.
    Creating Caché PackageManager Implementation Update
  • 20.
    • Which containerformat is the suitable for our packages? – ZIP would be ideal – But even Studio Project XML will fit the purpose • even now it handles all interesting file types (CLS, RTN, INC, CSP, ZEN, CSS, GIF, etc.) • Yes, XML is very inefficient, bloated, and keeps binary data as base64 (i.e. 3/2x length increase) • But it’s not a big deal for initial step; Container Format Plans – December 2014 Which Container? ZIP XML
  • 21.
    Plans – December2014 • What information should be in metadata? – At least dependency on other packages (name, version, url); – Anything from Node.js package.json could be reused by us, but; • JSON is not yet natively supported now, so could start from XML serialization of the same information (metainfo.xml) Metadata File { "dependencies" : { "foo" : "1.0.0 - 2.9999.9999" , "bar" : ">=1.0.2 <2.1.2" , "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0" , "asd" : "http://asdf.com/asdf.tar.gz" , "til" : "~1.2" , "elf" : "~1.2.3" , "lat" : "latest" , "dyl" : "file:../dyl" } }
  • 22.
    Reality – March2015 • We decided to use npm services for publishing to the server; • It accepts package.json as metadata description; • npm packs generated XML file to the .TGZ container which is being published to the repo; Container and metadata formats export /minor package CPM package/package.json package/package.xml package/package.tgz NPM /-/all/ - JSON index CouchDB
  • 23.
    Plans – December2014 • There is tough problem to handle – dependency on a system packages which may be presented only on some product flavors: – iKnow, – Ensemble – DeepSee, – TrakCare, – HealthShare, – particular version of product • May mark this dependency in the general dependency list as “iKnow”, “Ensemble 2013.1+”, etc. • But it’s too early to handle in the 1st iteration - we will revisit this later. Dependency on a system classes
  • 24.
  • 25.
    Plans – December2014 • From the practical prospective, taking into account multiple Caché platforms we should handle equally well (Windows, Linux, Mac OS X, or even VMS), and the fact that these FFI mechanisms are not yet officially supported, we should admit that they are not ready yet, and could not be recommended as a way to handle deploymenut of mixed C/COS packages. • We are not implementing them in v1.0 [Cross-platform] binary modules
  • 26.
    Not in V0.1 Reality– March 2015 [Cross-platform] binary modules
  • 27.
    Plans – December2014 • Having built-in mechanism for unit-testing has impacted positively the whole stability of CPAN ecosystem. –Package will not be installed at the user system unless it’s passing internal testing; • V1.0 will ignore unit-testing for a moment, but later, for binary modules deployment we should have unit-testing working Unit-testing
  • 28.
  • 29.
    Plans – December2014 • User experience is a big success booster, if system is inconvenient then it may be left unnoticed* • So both ways to invoke package manager should be working – To invoke package manager shell from any namespace in Cache’ terminal, .e.g – To install COS packages from command-line, e.g. • Eventually these operation might be wrapped in GUI. Not in V1.0 Command-line access do ^%CPM >install TOML-Parser cpm install deepsee-mobile-server
  • 30.
    • Command-line wrappercreated for Windows cpm.bat, which invokes default Caché instance with the command-line options entered; • Only single running instance handled today; Command-line access Reality – March 2015 C:UsersTimurDocumentsIntersystemssrcCPMbin>cpm list cpm-installer-sample 0.5.2 simple-proj 0.4.2 C:UsersTimurDocumentsIntersystemssrcCPMbin>cpm list /verbose cpm-installer-sample 0.5.2 Sample.Address.cls Sample.Company.cls Sample.Customer.cls Sample.Employee.cls Sample.Person.cls Sample.USZipCode.cls Sample.Utils.cls Sample.Vendor.cls simple.prj simple-proj 0.4.2 Sample.Address.CLS Sample.Company.CLS Sample.Customer.CLS Sample.Employee.CLS Sample.Person.CLS
  • 31.
    Plans – December2014 • There used to be old-dark times when every site had to handle DDoS on their own way, and to keep geo-spread mirror network for their purposes; • Now all is easily handled by VM host providers or special CDN providers: – Amazon Azure, Google Cloud, etc; – Amazon CloudFront, MaxCDN, etc; • Once we have static files (distributions files, static html descriptions, static images, etc) it could be easily handled by CDN; • But… for community site we supposed to have some dynamic part which will work with authors and new contributions Advices are welcome how to handle this mix easily and in most effective way Mirroring and CDN
  • 32.
    Reality – March2015 • We have selected CouchDB database hosting for keeping packages metadata and their content; • CouchDB is the JSON database store accessible via full RESTful API; • Same/similar database store is used for keeping NPM.js repository; –Thus we could use npm command-line utility for operations with this store if repository redefined to ours; Mirroring and CDN CouchDB repository
  • 33.
  • 34.
    Plans – December2014 Suggested usage cases for V1.0 Package User COS System COS Binaries Good for v1.0 iKnowSocial Yes No No Good Atom-COS-Studio Yes Yes Yes (Atom + extension) Bad WebTerminal No Yes No Good CNA Yes No Yes (callout module) Bad Coslint Yes (deployed OBJ code) No No Probably (deployed)
  • 35.
    Actual usage casesfor V0.1 Reality – March 2015 Package User COS System COS Cache-tort-git Yes Yes iKnowSocial Yes No Monlbl-viewer Yes No WebTerminal Yes Yes Simple-proj Yes No Cpm-installer-sample Yes No
  • 36.
    • Help, H,? • Quit, Q CPM Shell Commands
  • 37.
    • List, L CPMShell Commands
  • 38.
    • List /verbose CPMShell Commands
  • 39.
    • Install, I –Fromrepo –From local file(s) CPM Shell Commands
  • 40.
    • Package, P –/create/from –/description –/author CPM Shell Commands CPM:CPM>> package /create cache-tort-git /author adaptun /from pathtocache-tort-git Load of directory started on 03/16/2015 15:11:45 Loading file C:UsersTimurDocumentsGitHubcache-tort-gitcache-tort-git.prj… Imported project: cache-tort-git.prj Loading file C:UsersTimurDocumentsGitHubcache-tort-git%SourceControlGit… Imported class: %SourceControl.Git Loading file C:UsersTimurDocumentsGitHubcache-tort-git%SourceControlGit… Imported class: %SourceControl.Git.Utils Loading file C:UsersTimurDocumentsGitHubcache-tort-gitcspgitprojectset… Imported CSP/CSR or file: csp/cpm/gitprojectsettings.csp Compilation started on 03/16/2015 15:11:46 with qualifiers 'ck', compiling 2 classes, using 4 worker jobs Compiling class %SourceControl.Git.Utils Compiling class %SourceControl.Git
  • 41.
    • Export, E –/minor –/major CPMShell Commands CPM:CPM>> export /major cache-tort-git cache-tort-git version set to: 0.1.1 Exporting package files to: C:InterSystemsCacheLatest.cpmcache- tort-git Deleted all files in the directory: Exporting to XML started on 03/16/2015 15:12:04 Exporting class: %SourceControl.Git.Utils Exporting class: %SourceControl.Git Exporting project: cache-tort-git.prj Exporting CSP/CSR or file: /csp/cpm/gitprojectsettings.csp Export finished successfully.
  • 42.
    • Npm publish Command-Line C:InterSystemsCacheLatest.cpmcache-tort-git>npmpublish --registry http://cpmiscregistry.couchappy.com + cache-tort-git@0.1.1
  • 43.
    • Every respectedrepository has good name and an appropriate avatar; • We will appreciate any suggestion about CPM URL name and avatar! Name and avatar suggestions
  • 44.