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

44
Тимур Сафин Новый InterSystems: open-source, митапы, хакатоны

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

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

Тимур Сафин

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

Page 2: Новый 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

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

• Проект Atelier делает многое по новому

–Open-source Eclipse-based окружение

–Работа с внешними контрибьютерами через GitHub

–Code review, Continuous Integration, всё по-модному

–Облачное тестирование через Docker

–Исходники Atelier будут опубликованы*

InterSystems меняется

* Скорее всего. Таковы текущие планы

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

• InterSystems уже на GitHub

*Пока нет легкого способа найти исходники Caché

ObjectScript на GitHub

Open source сообщество

Hub # of forks # of repos

Intersystems-ru 46 48

Intersystems 29 4

Intersystems-ib 1 5

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

• 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

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

Meetups

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

• 1st InterSystems hackathon

• 10 proposed ideas

• 7 teams formed and started

• 4 remarkable results

Hackathon

http://writeimagejournal.com/?p=1912

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

• [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

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

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() .where("Carma < 100 OR Carma > 140") .where("$id > 10") .orderByDesc("Carma") .orderBy("Name") .exec(function(res) { console.table(res); }); });

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

• 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

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

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'

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

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

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

• 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

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

CacheBlocksExplorer – B*-tree

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

CacheBlocksExplorer – blocks map

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

This always starts with the people

doublefint

gnibeda

ZitRos

daimor

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

Package Manager

http://cpmteam.github.io/CPM/

do ^CPM

cpm install webterminal

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

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

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

Creating Caché Package ManagerImplementation Update

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

• 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

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

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"

}

}

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

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

CPMpackage/package.json

package/package.xml

package/package.tgz

NPM/-/all/ - JSON index

CouchDB

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

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

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

Dependencies

Not in V0.1

Reality – March 2015

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

Plans – December 2014

• From the practical prospective, taking into accountmultiple Caché platforms we should handle equally well(Windows, Linux, Mac OS X, or even VMS), and the factthat these FFI mechanisms are not yet officiallysupported, we should admit that they are not ready yet, and could not be recommended as a way to handledeploymenut of mixed C/COS packages.

• We are not implementing them in v1.0

[Cross-platform] binary modules

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

Not in V0.1

Reality – March 2015

[Cross-platform] binary modules

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

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

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

Unit-testing

Not in V0.1

Reality – March 2015

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

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

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

• 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:\Users\Timur\Documents\Intersystems\src\CPM\bin>cpm list

cpm-installer-sample 0.5.2simple-proj 0.4.2

C:\Users\Timur\Documents\Intersystems\src\CPM\bin>cpm list /verbose

cpm-installer-sample 0.5.2Sample.Address.clsSample.Company.clsSample.Customer.clsSample.Employee.clsSample.Person.clsSample.USZipCode.clsSample.Utils.clsSample.Vendor.clssimple.prj

simple-proj 0.4.2Sample.Address.CLSSample.Company.CLSSample.Customer.CLSSample.Employee.CLSSample.Person.CLS

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

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

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

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

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

CouchDB repository

Reality – March 2015

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

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)

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

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

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

• Help, H, ?

• Quit, Q

CPM Shell Commands

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

• List, L

CPM Shell Commands

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

• List /verbose

CPM Shell Commands

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

• Install, I

– From repo

– From local file(s)

CPM Shell Commands

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

• Package, P

– /create /from

– /description

– /author

CPM Shell Commands

CPM:CPM>> package /create cache-tort-git /author adaptun/from \path\to\cache-tort-git\Load of directory started on 03/16/2015 15:11:45

Loading file C:\Users\Timur\Documents\GitHub\cache-tort-git\cache-tort-git.prj…Imported project: cache-tort-git.prjLoading file C:\Users\Timur\Documents\GitHub\cache-tort-git\%SourceControl\Git…Imported class: %SourceControl.GitLoading file C:\Users\Timur\Documents\GitHub\cache-tort-git\%SourceControl\Git…Imported class: %SourceControl.Git.UtilsLoading file C:\Users\Timur\Documents\GitHub\cache-tort-git\csp\gitprojectset…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 jobsCompiling class %SourceControl.Git.UtilsCompiling class %SourceControl.Git

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

• Export, E

– /minor

– /major

CPM Shell Commands

CPM:CPM>> export /major cache-tort-gitcache-tort-git version set to: 0.1.1

Exporting package files to: C:\InterSystems\CacheLatest\.cpm\cache-tort-gitDeleted all files in the directory:

Exporting to XML started on 03/16/2015 15:12:04Exporting class: %SourceControl.Git.UtilsExporting class: %SourceControl.GitExporting project: cache-tort-git.prjExporting CSP/CSR or file: /csp/cpm/gitprojectsettings.cspExport finished successfully.

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

• Npm publish

Command-Line

C:\InterSystems\CacheLatest\.cpm\cache-tort-git>npm publish --registry http://cpmiscregistry.couchappy.com+ [email protected]

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

• 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

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

Package Manager

http://cpmteam.github.io/CPM/

do ^CPM

cpm install webterminal