12 Commits

Author SHA1 Message Date
d80c59afce Merge branch 'main' into deploy-context
Some checks failed
Build / Build-and-ng-test (pull_request) Has been cancelled
Build / Build-and-test-development (pull_request) Has been cancelled
2025-06-05 12:30:19 +00:00
abdbb67471 fix: viya deploy load data timing
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 4m0s
Build / Build-and-test-development (pull_request) Failing after 2h56m12s
2025-06-05 12:07:26 +02:00
037a97b6ff fix: automatic viya deploy timing issue 2025-06-04 17:37:44 +02:00
a0a529ad38 style: lint 2025-06-04 17:36:13 +02:00
72239558af feat: viya deploy, update the index.html contextname 2025-06-04 17:35:15 +02:00
d2097ad6dd chore(release): 6.15.2 [skip ci]
## [6.15.2](https://git.datacontroller.io/dc/dc/compare/v6.15.1...v6.15.2) (2025-06-04)

### Bug Fixes

* pipeline updates for DC.html ([624a7a8](624a7a8f37))
2025-06-04 14:26:44 +00:00
1bd542cddb Merge pull request 'fix: pipeline updates for DC.html' (#165) from issue156b into main
All checks were successful
Release / Build-production-and-ng-test (push) Successful in 4m29s
Release / Build-and-test-development (push) Successful in 8m37s
Release / release (push) Successful in 8m17s
Reviewed-on: #165
2025-06-04 13:53:24 +00:00
fb1c1ee874 Merge branch 'main' into issue156b
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 4m1s
Build / Build-and-test-development (pull_request) Successful in 8m34s
2025-06-04 13:48:58 +00:00
624a7a8f37 fix: pipeline updates for DC.html
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 4m5s
Build / Build-and-test-development (pull_request) Successful in 8m42s
2025-06-04 14:41:36 +01:00
381378f532 chore(release): 6.15.1 [skip ci]
## [6.15.1](https://git.datacontroller.io/dc/dc/compare/v6.15.0...v6.15.1) (2025-06-04)

### Bug Fixes

* updating pipeline to default to streaming on viya ([4b55894](4b558948d9))
2025-06-04 12:57:08 +00:00
af05486c0e Merge pull request 'fix: updating pipeline to default to streaming on viya' (#164) from issue156b into main
Some checks failed
Release / Build-production-and-ng-test (push) Successful in 3m57s
Release / Build-and-test-development (push) Successful in 8m41s
Release / release (push) Failing after 7m35s
Reviewed-on: #164
2025-06-04 12:28:12 +00:00
4b558948d9 fix: updating pipeline to default to streaming on viya
All checks were successful
Build / Build-and-ng-test (pull_request) Successful in 4m4s
Build / Build-and-test-development (pull_request) Successful in 8m33s
Also added error captures on makedata
2025-06-04 13:27:28 +01:00
9 changed files with 162 additions and 47 deletions

View File

@ -237,20 +237,20 @@ jobs:
cd sas
sasjs c -t viya
rm -rf sasjsbuild/tests
sed -i -e 's/servertype="SASJS"/servertype="SASVIYA"/g' sasjsbuild/services/clickme.html
sasjs b -t viya
cp sasjsbuild/viya.sas ./demostream_viya.sas
# compile Viya Full deploy (without web)
rm -rf sasjsbuild/services/web
rm sasjsbuild/services/clickme.html
sed -i -e 's/servertype="SASJS"/servertype="SASVIYA"/g' sasjsbuild/services/DC.html
sasjs b -t viya
cp sasjsbuild/viya.sas ./viya.sas
cp sasjsbuild/viya.json ./viya.json
# compile Viya Full deploy (without web)
rm -rf sasjsbuild/services/web
rm sasjsbuild/services/DC.html
sasjs b -t viya
cp sasjsbuild/viya.sas ./viya_noweb.sas
cp sasjsbuild/viya.json ./viya_noweb.json
- name: Zip Frontend (including viya.json for full viya deploy)
run: |
cd sas
cp sasjsbuild/viya.json ../client/dist
cp sasjsbuild/viya.json ../client/dist/viya.json
cd ..
zip -r frontend.zip ./client/dist
@ -277,8 +277,8 @@ jobs:
URL="https://git.datacontroller.io/api/v1/repos/dc/dc/releases/$RELEASE_ID/assets?access_token=${{ secrets.RELEASE_TOKEN }}"
curl -k $URL -F attachment=@frontend.zip
curl -k $URL -F attachment=@sas/demostream_sas9.sas
curl -k $URL -F attachment=@sas/demostream_viya.sas
curl -k $URL -F attachment=@sas/viya.sas
curl -k $URL -F attachment=@sas/sasjs_server.json.zip
curl -k $URL -F attachment=@sas/sas9.sas
curl -k $URL -F attachment=@sas/viya.sas
curl -k $URL -F attachment=@sas/viya.json
curl -k $URL -F attachment=@sas/viya_noweb.sas
curl -k $URL -F attachment=@sas/viya_noweb.json

View File

@ -1,3 +1,17 @@
## [6.15.2](https://git.datacontroller.io/dc/dc/compare/v6.15.1...v6.15.2) (2025-06-04)
### Bug Fixes
* pipeline updates for DC.html ([624a7a8](https://git.datacontroller.io/dc/dc/commit/624a7a8f37f0265cf576da310ac330c75aa417cf))
## [6.15.1](https://git.datacontroller.io/dc/dc/compare/v6.15.0...v6.15.1) (2025-06-04)
### Bug Fixes
* updating pipeline to default to streaming on viya ([4b55894](https://git.datacontroller.io/dc/dc/commit/4b558948d997f456ff25a12a58827fe0d2075493))
# [6.15.0](https://git.datacontroller.io/dc/dc/compare/v6.14.10...v6.15.0) (2025-06-04)

View File

@ -86,19 +86,19 @@ export class AutomaticComponent implements OnInit {
) {}
ngOnInit(): void {
const promiseGetAadminGroups = this.getAdminGroups()
const getCurrentUser = this.getCurrentUser()
const getComputeContexts = this.getComputeContexts()
this.loadData()
}
Promise.all([
promiseGetAadminGroups,
getCurrentUser,
getComputeContexts
]).then(() => {
public async loadData() {
await this.getAdminGroups()
await this.getComputeContexts()
await this.getCurrentUser()
setTimeout(() => {
if (this.selectedComputeContext) {
this.onComputeContextChange(this.selectedComputeContext)
}
})
}, 500)
}
public async getComputeContexts() {
@ -144,6 +144,7 @@ export class AutomaticComponent implements OnInit {
resolve()
},
(err) => {
console.error('Error while getting current user', err)
reject(err)
}
)
@ -190,6 +191,14 @@ export class AutomaticComponent implements OnInit {
})
}
public getComputeContextName(id: string): string | undefined {
return (
this.computeContexts.find(
(context: ComputeContextItem) => context.id === id
)?.name || undefined
)
}
/**
* Executes sas.json file to deploy the backend
* Method will first try to run the `auto deploy`
@ -265,13 +274,12 @@ export class AutomaticComponent implements OnInit {
let selectedComputeContextName = this.sasJsConfig.contextName
if (this.selectedComputeContext.length && this.computeContexts.length) {
const computeContext = this.computeContexts.find(
(context: ComputeContextItem) =>
context.id === this.selectedComputeContext
const computeContextName = this.getComputeContextName(
this.selectedComputeContext
)
if (computeContext) {
selectedComputeContextName = computeContext.name
if (computeContextName) {
selectedComputeContextName = computeContextName
}
}
@ -287,14 +295,9 @@ export class AutomaticComponent implements OnInit {
}
this.sasJs
.request(
`services/admin/makedata&_contextname=${selectedComputeContextName}`,
data,
overrideConfig,
() => {
this.sasService.shouldLogin.next(true)
}
)
.request(`services/admin/makedata`, data, overrideConfig, () => {
this.sasService.shouldLogin.next(true)
})
.then((res: any) => {
this.autodeployDone = true
@ -321,6 +324,8 @@ export class AutomaticComponent implements OnInit {
MAC: macMsg
})
}
this.updateIndexHtmlComputeContext()
})
.catch((err: any) => {
this.eventService.showAbortModal('makedata', JSON.stringify(err))
@ -335,6 +340,50 @@ export class AutomaticComponent implements OnInit {
})
}
/**
* Only when on Viya, this method will update the `contextname` in the `DataController.html` on the SAS drive
* This is needed to ensure that the DC will use the same compute context `makedata` service used to run against.
*/
public async updateIndexHtmlComputeContext() {
const indexHtmlContent = await this.sasService.getFileContent(
`${this.appLoc}/services`,
'DataController.html'
)
if (!indexHtmlContent) {
this.loggerService.error(
`Failed to get DataController.html at ${this.appLoc}/services`
)
return
}
const computeContextName = this.getComputeContextName(
this.selectedComputeContext
)
if (!computeContextName) {
this.loggerService.error(
`Compute context name not found for ID: ${this.selectedComputeContext} | List: ${JSON.stringify(this.computeContexts)}`
)
return
}
const updatedContent = indexHtmlContent.replace(
/contextname="[^"]*"/g,
`contextname="${computeContextName}"`
)
await this.sasService
.updateFileContent(
`${this.appLoc}/services`,
'DataController.html',
updatedContent
)
.catch((err: any) => {
this.loggerService.error(`Failed to update DataController.html: ${err}`)
})
}
public downloadFile(
content: any,
filename: string,

View File

@ -657,4 +657,17 @@ export class SasService {
}
}
}
// Viya specific functions
public getFileContent(folderPath: string, fileName: string) {
return this.sasjsAdapter.getFileContent(folderPath, fileName)
}
public updateFileContent(
folderPath: string,
fileName: string,
content: string
) {
return this.sasjsAdapter.updateFileContent(folderPath, fileName, content)
}
}

View File

@ -1,6 +1,6 @@
{
"name": "dcfrontend",
"version": "6.15.0",
"version": "6.15.2",
"description": "Data Controller",
"devDependencies": {
"@saithodev/semantic-release-gitea": "^2.1.0",

16
sas/package-lock.json generated
View File

@ -6,7 +6,7 @@
"": {
"name": "dc-sas",
"dependencies": {
"@sasjs/cli": "^4.12.5",
"@sasjs/cli": "^4.12.7",
"@sasjs/core": "^4.58.1"
}
},
@ -45,14 +45,14 @@
}
},
"node_modules/@sasjs/cli": {
"version": "4.12.5",
"resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-4.12.5.tgz",
"integrity": "sha512-y6JFATKlTyTl0gRPpDBPL1rwZsyeuyp5uEz7HMA7raSzQuNa6QZ1oO1Er91I7+cLUg0Ndh5aSNGKYOdBRStQ2g==",
"version": "4.12.7",
"resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-4.12.7.tgz",
"integrity": "sha512-KcXSR+3dRgINOLiN+7oJbzWsNQu7qm1YQ7eaVqiHTZI429BSgZez9+7p1bq09R4otHN8IzMAgLP9se/r9p9yJA==",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
"@sasjs/adapter": "4.11.3",
"@sasjs/core": "4.57.0",
"@sasjs/core": "4.58.1",
"@sasjs/lint": "2.4.3",
"@sasjs/utils": "3.5.2",
"adm-zip": "0.5.10",
@ -76,12 +76,6 @@
"sasjs": "build/index.js"
}
},
"node_modules/@sasjs/cli/node_modules/@sasjs/core": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.57.0.tgz",
"integrity": "sha512-iJiLnW4oY15InGerXXWtrjc1YpJ9UDz72+r7Odfr/yYR7RxIhtXGjYQIqyQu6US+cS/0b2pi12LZB6VnfMS/pA==",
"license": "MIT"
},
"node_modules/@sasjs/core": {
"version": "4.58.1",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.58.1.tgz",

View File

@ -28,7 +28,7 @@
},
"private": true,
"dependencies": {
"@sasjs/cli": "^4.12.5",
"@sasjs/cli": "^4.12.7",
"@sasjs/core": "^4.58.1"
}
}

View File

@ -127,6 +127,14 @@
"sasjs/utils/viyadeploy.sh"
]
},
"streamConfig": {
"streamWeb": true,
"streamWebFolder": "web",
"webSourcePath": "../client/dist",
"streamServiceName": "DC",
"streamLogo": "favicon.ico",
"assetPaths": []
},
"contextName": "SAS Job Execution compute context"
},
{

View File

@ -7,6 +7,7 @@
@li mf_getapploc.sas
@li mf_mkdir.sas
@li mf_trimstr.sas
@li mp_abort.sas
@li mpe_getvars.sas
@li mpe_makedata.sas
@li mpe_makedatamodel.sas
@ -50,9 +51,33 @@ options noquotelenmax;
%put &=admin;
%mf_mkdir(&dcpath)
%mp_abort(iftrue= (&syscc ne 0)
,mac=&_program
,msg=%str(Unable to create &dcpath using &sysuserid)
)
%mf_mkdir(&dcpath/secret)
%mf_mkdir(&dcpath/dc_staging)
/* check we have physical permissions to the DCLIB folder */
data _null_;
putlog "dcpath=&dcpath/permTest.txt";
putlog "sysuserid=&sysuserid";
data _null_;
file "&dcpath/permTest.txt";
run;
%mp_abort(iftrue= (&syscc ne 0)
,mac=&_program
,msg=%str(User &sysuserid does not have WRITE permissions to: &dcpath )
)
filename delfile "&dcpath/permTest.txt";
data _null_;
rc=fdelete('delfile');
run;
%mp_abort(iftrue= (&syscc ne 0)
,mac=&_program..sas
,msg=%str(User &sysuserid could create (but not delete) &dcpath/permTest.txt )
)
libname &dclib "&dcpath";
%global admin;
@ -60,11 +85,23 @@ libname &dclib "&dcpath";
%mpe_makedatamodel(lib=&dclib)
%mpe_makedata(lib=&dclib,mpeadmins=&admin,path=%str(&dcpath))
%mp_abort(iftrue=(&syscc ne 0)
,mac=&sysmacroname
,msg=%str(Err during &dclib build)
)
/* sample data library */
%mf_mkdir(&dcpath/dc_demo)
libname dcdemo "&dcpath/dc_demo";
%mpe_makesampledata(outlib=DCDEMO)
%mp_abort(iftrue=(&syscc ne 0)
,mac=&sysmacroname
,msg=%str(Err during demo data build)
)
/* the DC precode is stored in the root of the project */
%let root=%mf_getapploc(&_program)/services;
%put &=root;
@ -167,7 +204,7 @@ run;
*/
%mp_abort(iftrue=(&syscc ne 0)
,mac=&sysmacroname
,msg=%str(Err during DB build)
,msg=%str(Err during settings job creation)
)