From 4015972e8f5ff9c9d1bf7833371ddedd8f03129d Mon Sep 17 00:00:00 2001 From: sumanth Date: Wed, 3 Nov 2021 23:48:36 -0700 Subject: [PATCH 1/4] Add powershell script to run mog by providing more memory --- Mog_RunProvidingMoreMemory.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Mog_RunProvidingMoreMemory.ps1 diff --git a/Mog_RunProvidingMoreMemory.ps1 b/Mog_RunProvidingMoreMemory.ps1 new file mode 100644 index 00000000..6927fe8e --- /dev/null +++ b/Mog_RunProvidingMoreMemory.ps1 @@ -0,0 +1,9 @@ +$minMemory = Read-Host -Prompt "Enter the minimum memory(RAM) MOG should use in GB (Ex: 1)" +$maxMemory = Read-Host -Prompt "Enter the maximum memory(RAM) MOG can use in GB (Ex: 4)" +$minMemory = $minMemory + 'g' +$maxMemory = $maxMemory + 'g' + +$mogJarFile = Get-ChildItem -Path $PSScriptRoot -Filter *.jar | Select-Object -First 1 + +$javaRunCommand = "java -Xms" + $minMemory + " -Xmx" + $maxMemory + " -jar " + $PSScriptRoot + "\" + $mogJarFile +Invoke-Expression $javaRunCommand \ No newline at end of file From 2116f3e8f3e85503e0041e3218da1b922a0ba612 Mon Sep 17 00:00:00 2001 From: sumanth Date: Wed, 3 Nov 2021 23:51:41 -0700 Subject: [PATCH 2/4] Update yaml file to include the powershell script in artifacts --- .github/workflows/main.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b03fb1b8..4f90798d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,24 +64,30 @@ jobs: - name: Build with Maven run: mvn -B package --file pom.xml - + + - name: Copy File + run: | + mkdir MOG + cp ${{github.workspace}}/todo.txt ${{github.workspace}}/MOG/ + cp ${{github.workspace}}/target/*.jar ${{github.workspace}}/MOG/ + - name: Upload Jar - macOS if: ${{ matrix.os == 'macos-latest'}} uses: actions/upload-artifact@v2 with: name: 'Artifacts-MacOS' - path: /Users/runner/work/MetaOmGraph/MetaOmGraph/target/*.jar + path: ${{github.workspace}}/MOG/* - name: Upload Jar - Linux if: ${{ matrix.os == 'ubuntu-latest'}} uses: actions/upload-artifact@v2 with: name: 'Artifacts-Linux' - path: /home/runner/work/MetaOmGraph/MetaOmGraph/target/*.jar - + path: ${{github.workspace}}/MOG/* + - name: Upload Jar - Windows if: ${{ matrix.os == 'windows-latest'}} uses: actions/upload-artifact@v2 with: name: 'Artifacts-Windows' - path: D:\a\MetaOmGraph\MetaOmGraph\target\*.jar + path: ${{github.workspace}}\MOG\* From d4f126ba23c69d977d26ca0f4c4e02944035702c Mon Sep 17 00:00:00 2001 From: sumanth Date: Thu, 4 Nov 2021 00:12:07 -0700 Subject: [PATCH 3/4] Update temp file to powershell file --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f90798d..0b0642a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: - name: Copy File run: | mkdir MOG - cp ${{github.workspace}}/todo.txt ${{github.workspace}}/MOG/ + cp ${{github.workspace}}/Mog_RunProvidingMoreMemory.ps1 ${{github.workspace}}/MOG/ cp ${{github.workspace}}/target/*.jar ${{github.workspace}}/MOG/ - name: Upload Jar - macOS From c974399c5603ee10e9c6d5d378901480ff860871 Mon Sep 17 00:00:00 2001 From: sumanth Date: Thu, 4 Nov 2021 00:46:43 -0700 Subject: [PATCH 4/4] Make powershell script OS independent --- Mog_RunProvidingMoreMemory.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mog_RunProvidingMoreMemory.ps1 b/Mog_RunProvidingMoreMemory.ps1 index 6927fe8e..f21ba53d 100644 --- a/Mog_RunProvidingMoreMemory.ps1 +++ b/Mog_RunProvidingMoreMemory.ps1 @@ -3,7 +3,9 @@ $maxMemory = Read-Host -Prompt "Enter the maximum memory(RAM) MOG can use in GB $minMemory = $minMemory + 'g' $maxMemory = $maxMemory + 'g' -$mogJarFile = Get-ChildItem -Path $PSScriptRoot -Filter *.jar | Select-Object -First 1 +$mogJarFile = Get-ChildItem -Path $PSScriptRoot -Filter *.jar | Select Name -$javaRunCommand = "java -Xms" + $minMemory + " -Xmx" + $maxMemory + " -jar " + $PSScriptRoot + "\" + $mogJarFile +$jarPath = Join-Path -Path $PSScriptRoot -ChildPath $mogJarFile.name + +$javaRunCommand = "java -Xms" + $minMemory + " -Xmx" + $maxMemory + " -jar " + $jarPath Invoke-Expression $javaRunCommand \ No newline at end of file