Book a Demo

Author Topic: Access EA DBMS from Jenkins Build Job  (Read 27878 times)

siaccarino

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-1
    • View Profile
Access EA DBMS from Jenkins Build Job
« on: August 22, 2018, 04:17:27 pm »
Hi,

this is what I have:
  • EA 12
  • Jenkins (runs as a service with local system account)
  • Model in a MySQL DB using windows authentication

this is what I want:
  • Creating a local file snapshot from DB
  • Removing user security from the snapshot
  • Creating html report from the snapshot

this is what I did:
  • Defined ODBC System DSN
  • Registered EA license for local system account in EA
  • Added a special user account "jenkins" at DB
  • Written small C# tools to access the model
  • Added "EA.Repository.SuppressSecurityDialog = true" to my tools

and finally this is what I get:
  • EA.Project.ProjectTransfer(dsn,snapshot) works fine - so the license and ODBC DSN are working
  • EA.Repository.OpenFile2(snapshot,DBuser,DBPassword) hangs
  • EA.Repository.OpenFile2(dsn,DBuser,DBPassword) hangs

Everything works when I do the steps manually on the machine - so name and password for the snapshot are correct.

My assumption is that EA tries to open a dialog even though I forbid dialogs via SuppressSecurityDialog.

Is there anything I can do to detect why OpenFile2 hangs?
« Last Edit: March 18, 2019, 06:05:20 pm by siaccarino »

siaccarino

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-1
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #1 on: August 22, 2018, 04:43:44 pm »
I managed to get one step further:
If I allow the jenkins service to interact with desktop my job works even though no dialog appears.
This looks pretty much like an implementation error of SuppressSecurityDialog in Enterprise Architect...

siaccarino

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-1
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #2 on: March 12, 2019, 05:48:49 am »
This solution will no longer work with Windows 10. I didn't find any solution working with Windows 10. OpenFile2 always terminates.

Is a PC with a logged on user and the windows task scheduler really the only solution for automated EA tasks? Really?

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #3 on: March 12, 2019, 08:05:46 am »
Is a PC with a logged on user and the windows task scheduler really the only solution for automated EA tasks? Really?

You seem to be struggling with the concept of user contexts.  Operating Systems separate the contexts for very valid reasons and have done for a very long time.  The separation is getting stronger because bad actors exploit any weakness.

The explanation for why it is failing is in your description of what you are doing.

siaccarino

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-1
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #4 on: March 12, 2019, 05:34:07 pm »
Yes I know - and it would likely not be a problem if EA would handle SuppressEADialogs / SuppressSecurityDialog correctly so it would run without any window context.
In bigger projects (>= 50) there are usually a lot of maintenance tasks related to the model (eg. integration into quality reports etc.).
My intention is absolutely legitimate and the lack of adequate maintenance access will certainly lead us to look for alternatives in the medium term.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Access EA DBMS from Jenkins Build Job
« Reply #5 on: March 12, 2019, 05:58:28 pm »
I'm guessing (because we don't know the roadmap of Sparx) that automated maintenance tasks will be enabled later through the cloud server.

From an architectural point of view that is the right place for these type of things.
IIRC there are only a very limited (2?) of these type of tasks made available currently.

Geert

siaccarino

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-1
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #6 on: March 12, 2019, 06:22:28 pm »
I think different - the cloud host is responsible to provide user access to the EA DBMS.
But maintenance tools shall be completely separated from users.
Usually companies have a complete infrastructure for things like quality or tracing reports and synchronization with other infrastructure entities.
Even when the EA cloud host provides reports a distinct maintenance access port is still required.

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #7 on: March 13, 2019, 07:25:08 am »
From an architectural point of view that is the right place for these type of things.
IIRC there are only a very limited (2?) of these type of tasks made available currently.

From an architectural perspective the right approach is not to try and behave like malware or provide vulnerabilities for malware.

siaccarino

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-1
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #8 on: March 13, 2019, 08:31:03 pm »
From an architectural point of view that is the right place for these type of things.
IIRC there are only a very limited (2?) of these type of tasks made available currently.

From an architectural perspective the right approach is not to try and behave like malware or provide vulnerabilities for malware.
I see - and what exactly do you want to tell us with this statement?

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 344
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
Re: Access EA DBMS from Jenkins Build Job
« Reply #9 on: March 14, 2019, 02:56:58 am »
Did you assign a valid EA license for the Jenkins user? this is the dialog you can't see, EA asking for a valid license, which is different from the license of your windows user.

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #10 on: March 14, 2019, 09:32:00 am »
Did you assign a valid EA license for the Jenkins user? this is the dialog you can't see, EA asking for a valid license, which is different from the license of your windows user.

He's not running Jenkins as a user.  If he was running everything in the same context he'd have fewer issues.

siaccarino

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-1
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #11 on: March 14, 2019, 07:47:41 pm »
Jenkins is running under local system account. I entered the license data once by starting EA on the host via psexec under local system account.
Project transfer is working - so it is likely neither a license nor a DCOM issue.
Same setup works with a win7 host - if I allow Jenkins interaction with desktop
« Last Edit: March 14, 2019, 07:51:14 pm by siaccarino »

siaccarino

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-1
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #12 on: March 14, 2019, 07:54:14 pm »
For me it sounds pretty much like EA tries to create an invisible window or access a GUI resource and runs into an exception.
« Last Edit: March 14, 2019, 07:56:23 pm by siaccarino »

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #13 on: March 18, 2019, 08:01:01 am »
Jenkins is running under local system account.

Local system is not a user account.

siaccarino

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-1
    • View Profile
Re: Access EA DBMS from Jenkins Build Job
« Reply #14 on: March 18, 2019, 06:02:38 pm »
Jenkins is running under local system account.

Local system is not a user account.
Yeah, that's for sure. And?

Why does EA require a physical logged on user account if I pass the DB credentials via EA API (OpenFile2 instead of OpenFile) and disabled all UI dialogs?