This repository has been archived by the owner on Apr 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from kaviththiranga/master
Fixes to cache & compiler
- Loading branch information
Showing
20 changed files
with
103 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
org_name = "ballerina.io" | ||
org_name = "ballerina.playground" | ||
version = "1.0.0" | ||
lockfile_version = "1.0.0" | ||
ballerina_version = "1.0.2" | ||
ballerina_version = "1.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
import ballerina/crypto; | ||
import ballerina/cache; | ||
|
||
cache:Cache inMemCache = new(); | ||
|
||
function getCacheId(string sourceCode, string balVersion) returns string? { | ||
function getCacheId(string sourceCode, string balVersion) returns string { | ||
string cacheSource = sourceCode + balVersion; | ||
return crypto:hashMd5(cacheSource.toBytes()).toBase16(); | ||
} | ||
|
||
function hasCachedOutput(string cacheId) returns boolean { | ||
return inMemCache.hasKey(cacheId); | ||
} | ||
|
||
function getCachedOutput(string cacheId) returns string? { | ||
return <string?> inMemCache.get(cacheId); | ||
} | ||
|
||
function setCachedOutput(string cacheId, string output) { | ||
inMemCache.put(cacheId, output); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
org_name = "ballerina.io" | ||
org_name = "ballerina.playground" | ||
version = "1.0.0" | ||
lockfile_version = "1.0.0" | ||
ballerina_version = "1.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
api/executor/src/playground_executor/utils/cache_utils.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
import ballerina/crypto; | ||
import ballerina/cache; | ||
|
||
cache:Cache inMemCache = new(); | ||
|
||
function getCacheId(string sourceCode, string balVersion) returns string { | ||
string cacheSource = sourceCode + balVersion; | ||
return crypto:hashMd5(cacheSource.toBytes()).toBase16(); | ||
} | ||
|
||
function hasCachedOutput(string cacheId) returns boolean { | ||
return inMemCache.hasKey(cacheId); | ||
} | ||
|
||
function getCachedOutput(string cacheId) returns string? { | ||
return <string?> inMemCache.get(cacheId); | ||
} | ||
|
||
function setCachedOutput(string cacheId, string output) { | ||
inMemCache.put(cacheId, output); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
steps: | ||
- name: 'gcr.io/cloud-builders/docker' | ||
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/playground-compiler','--build-arg', | ||
args: [ 'build', '-t', '$_IMAGE_TAG','--build-arg', | ||
'BALLERINA_VERSION=$_BALLERINA_VERSION', '.' ] | ||
images: | ||
- 'gcr.io/$PROJECT_ID/playground-compiler' | ||
- '$_IMAGE_TAG' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
steps: | ||
- name: 'gcr.io/cloud-builders/docker' | ||
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/playground-controller', '.' ] | ||
args: [ 'build', '-t', '$_IMAGE_TAG', '.' ] | ||
images: | ||
- 'gcr.io/$PROJECT_ID/playground-controller' | ||
- '$_IMAGE_TAG' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
steps: | ||
- name: 'gcr.io/cloud-builders/docker' | ||
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/playground-executor', '.' ] | ||
args: [ 'build', '-t', '$_IMAGE_TAG', '.' ] | ||
images: | ||
- 'gcr.io/$PROJECT_ID/playground-executor' | ||
- '$_IMAGE_TAG' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.