Skip to content

Commit

Permalink
Merge branch 'master' into java_17_migration
Browse files Browse the repository at this point in the history
  • Loading branch information
gabilang authored Jul 26, 2023
2 parents 81d3cd4 + c8c831d commit 2dacf33
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 33 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/fossa_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Fossa Scan
on:
workflow_dispatch:
schedule:
- cron: '30 18 * * *' # 00:00 in LK time (GMT+5:30)
jobs:
fossa-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: fossas/fossa-action@main
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
with:
api-key: ${{secrets.FOSSA_APIKEY}}
2 changes: 1 addition & 1 deletion ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerina"
name = "cloud"
version = "2.9.1"
version = "2.9.0"
repository = "https://github.com/ballerina-platform/module-ballerina-c2c"
license = ["Apache-2.0"]
keywords = ["cloud", "kubernetes", "docker", "k8s", "c2c"]
Expand Down
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "code2cloud"
class = "io.ballerina.c2c.C2CCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/cloud-compiler-plugin-2.9.1-SNAPSHOT.jar"
path = "../compiler-plugin/build/libs/cloud-compiler-plugin-2.9.0.jar"
4 changes: 2 additions & 2 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.8.0-SNAPSHOT"
distribution-version = "2201.7.0"

[[package]]
org = "ballerina"
name = "cloud"
version = "2.9.1"
version = "2.9.0"
modules = [
{org = "ballerina", packageName = "cloud", moduleName = "cloud"}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void validateDeployment() {
// Assert Containers
Container container = deployment.getSpec().getTemplate().getSpec().getContainers().get(0);
Assert.assertEquals(container.getImage(), DOCKER_IMAGE);
Assert.assertEquals(container.getResources().getLimits().get("memory").toString(), "256Mi");
Assert.assertEquals(container.getResources().getLimits().get("memory").toString(), "512Mi");
Assert.assertEquals(container.getResources().getLimits().get("cpu").toString(), "500m");
Assert.assertEquals(container.getResources().getRequests().get("cpu").toString(), "200m");
Assert.assertEquals(container.getResources().getRequests().get("memory").toString(), "100Mi");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"character": 0
}
},
"newText":"# This file contains most used configurations supported by Ballerina Code to Cloud\n# All the fields are optional. If these fields are not specified, default value will be taken from the compiler.\n# Full Code to Cloud specification can be accessed from https://github.com/ballerina-platform/ballerina-spec/blob/master/c2c/code-to-cloud-spec.md\n# Uncomment Any field below if you want to override the default value.\n\n# Settings related to artifacts generation\n#[settings]\n#buildImage = true # Build the Docker image while building the project\n#thinJar = true # Use the thin jars in the container\n#\n# Properties related to the container image\n#[container.image]\n#name = \"hello\" # Name of the container image\n#repository = \"ballerina\" # Container repository to host the container\n#tag = \"latest\" # Tag of the container\n#base = \"ballerina/jvm-runtime:1.0\" # Base container of the container image\n#\n# Copy the files to the container image\n#[[container.copy.files]]\n#sourceFile = \"./data/data.txt\" # Path to the external file\n#target = \"/home/ballerina/data/data.txt\" # Path of the file within the container\n#\n# External files required for the code\n#[[cloud.config.maps]]\n#file = \"resource/file.text\" # Path of the external file\n#mount_path = \"/home/ballerina/foo/file.conf\" # Path of the file in the container\n#\n# Environment variables required for the application\n#[[cloud.config.envs]]\n#key_ref = \"FOO\" # Key of the environment variable\n#name = \"foo\" # Name of the env if it is different from the key\n#config_name = \"module-foo\" # Name of the config config map\n#\n# Properties related to the deployment\n#[cloud.deployment]\n#min_memory = \"100Mi\" # Minimum memory allocated to the container\n#max_memory = \"256Mi\" # Maximum memory allocated to the container\n#min_cpu = \"200m\" # Minimum CPU allocated to the container\n#max_cpu = \"500m\" # Maximum CPU allocated to the container\n#\n# Matrices to auto-scale the container\n#[cloud.deployment.autoscaling]\n#min_replicas = 1 # Minimum number of replicas of the container alive at a given time\n#max_replicas = 2 # Maximum number of replicas of the container alive at a given time\n#cpu = 50 # CPU Utilization threshold for spawning a new instance\n#\n# Probe to indicate whether the container is ready to respond to requests. No readiness probe will be generated if not specified\n#[cloud.deployment.probes.readiness]\n#port = 9091 # Port of the readiness probe endpoint\n#path = \"/probes/readyz\" # Endpoint of the readiness probe\n#\n# Probe to indicate whether the container is running. No liveness probe will be generated if not specified\n#[cloud.deployment.probes.liveness]\n#port = 9091 # Port of the liveness probe endpoint\n#path = \"/probes/healthz\" # Endpoint of the liveness probe\n#\n# Volume definitions of the application. No default volumes will be generated if not specified\n#[[cloud.deployment.storage.volumes]]\n#name = \"volume1\" # Name of the volume\n#local_path = \"files\" # Path of the volume\n#size = \"2Gi\" # Maximum size of the volume\n#"
"newText":"# This file contains most used configurations supported by Ballerina Code to Cloud\n# All the fields are optional. If these fields are not specified, default value will be taken from the compiler.\n# Full Code to Cloud specification can be accessed from https://github.com/ballerina-platform/ballerina-spec/blob/master/c2c/code-to-cloud-spec.md\n# Uncomment Any field below if you want to override the default value.\n\n# Settings related to artifacts generation\n#[settings]\n#buildImage = true # Build the Docker image while building the project\n#thinJar = true # Use the thin jars in the container\n#\n# Properties related to the container image\n#[container.image]\n#name = \"hello\" # Name of the container image\n#repository = \"ballerina\" # Container repository to host the container\n#tag = \"latest\" # Tag of the container\n#base = \"ballerina/jvm-runtime:1.0\" # Base container of the container image\n#\n# Copy the files to the container image\n#[[container.copy.files]]\n#sourceFile = \"./data/data.txt\" # Path to the external file\n#target = \"/home/ballerina/data/data.txt\" # Path of the file within the container\n#\n# External files required for the code\n#[[cloud.config.maps]]\n#file = \"resource/file.text\" # Path of the external file\n#mount_path = \"/home/ballerina/foo/file.conf\" # Path of the file in the container\n#\n# Environment variables required for the application\n#[[cloud.config.envs]]\n#key_ref = \"FOO\" # Key of the environment variable\n#name = \"foo\" # Name of the env if it is different from the key\n#config_name = \"module-foo\" # Name of the config config map\n#\n# Properties related to the deployment\n#[cloud.deployment]\n#min_memory = \"100Mi\" # Minimum memory allocated to the container\n#max_memory = \"512Mi\" # Maximum memory allocated to the container\n#min_cpu = \"200m\" # Minimum CPU allocated to the container\n#max_cpu = \"500m\" # Maximum CPU allocated to the container\n#\n# Matrices to auto-scale the container\n#[cloud.deployment.autoscaling]\n#min_replicas = 1 # Minimum number of replicas of the container alive at a given time\n#max_replicas = 2 # Maximum number of replicas of the container alive at a given time\n#cpu = 50 # CPU Utilization threshold for spawning a new instance\n#\n# Probe to indicate whether the container is ready to respond to requests. No readiness probe will be generated if not specified\n#[cloud.deployment.probes.readiness]\n#port = 9091 # Port of the readiness probe endpoint\n#path = \"/probes/readyz\" # Endpoint of the readiness probe\n#\n# Probe to indicate whether the container is running. No liveness probe will be generated if not specified\n#[cloud.deployment.probes.liveness]\n#port = 9091 # Port of the liveness probe endpoint\n#path = \"/probes/healthz\" # Endpoint of the liveness probe\n#\n# Volume definitions of the application. No default volumes will be generated if not specified\n#[[cloud.deployment.storage.volumes]]\n#name = \"volume1\" # Name of the volume\n#local_path = \"files\" # Path of the volume\n#size = \"2Gi\" # Maximum size of the volume\n#"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public DeploymentModel() {
this.registry = "";
Map<String, Quantity> limit = new HashMap<>();
limit.put("cpu", new Quantity("500m"));
limit.put("memory", new Quantity("256Mi"));
limit.put("memory", new Quantity("512Mi"));
Map<String, Quantity> resource = new HashMap<>();
resource.put("cpu", new Quantity("200m"));
resource.put("memory", new Quantity("100Mi"));
Expand Down
2 changes: 1 addition & 1 deletion compiler-plugin/src/main/resources/c2c-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
"description": "Maximum memory allocated to the container",
"type": "string",
"pattern": "^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$",
"default": "256Mi"
"default": "512Mi"
},
"min_cpu": {
"description": "Minimum CPU allocated to the container",
Expand Down
2 changes: 1 addition & 1 deletion examples/kubernetes-resources-autoscaling/Cloud.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tag="sample3" # Tag of the container

[cloud.deployment]
min_memory="100Mi" # Minimum memory allocated to the container
max_memory="256Mi" # Maximum memory allocated to the container
max_memory="512Mi" # Maximum memory allocated to the container
min_cpu="200m" # Minimum CPU allocated to the container
max_cpu="500m" # Maximum CPU allocated to the container

Expand Down
4 changes: 2 additions & 2 deletions examples/kubernetes-resources-autoscaling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
```toml
[[cloud.deployment]]
min_memory="100Mi" # Minimum memory allocated to the container
max_memory="256Mi" # Maximum memory allocated to the container
max_memory="512Mi" # Maximum memory allocated to the container
min_cpu="200m" # Minimum CPU allocated to the container
max_cpu="500m" # Maximum CPU allocated to the container
```
Expand All @@ -59,7 +59,7 @@ template:
.
resources:
limits:
memory: "256Mi"
memory: "512Mi"
cpu: "500m"
requests:
memory: "100Mi"
Expand Down
44 changes: 22 additions & 22 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ org.gradle.jvmargs='-Dfile.encoding=UTF-8'
group=io.ballerina
version=2.9.1-SNAPSHOT
systemProp.org.gradle.internal.publish.checksums.insecure=true
ballerinaLangVersion=2201.7.0-20230619-175900-bb4e4544
stdlibConstraintVersion=1.3.0-20230620-195700-ca941bc
stdlibIoVersion=1.5.0-20230620-192100-29cf327
ballerinaLangVersion=2201.8.0-20230726-145300-b2bdf796
stdlibConstraintVersion=1.3.0
stdlibIoVersion=1.5.0
stdlibLogVersion=2.8.1-20230718-085900-36c385c
stdlibHttpVersion=2.9.0-20230621-211000-3a0a7fa
stdlibAuthVersion=2.9.0-20230620-221100-6b88179
stdlibFileVersion=1.8.0-20230620-210800-e8f8123
stdlibHttpVersion=2.9.1-20230712-161400-d16a019
stdlibAuthVersion=2.9.0
stdlibFileVersion=1.8.0
stdlibRegexVersion=1.4.3
stdlibCacheVersion=3.6.0-20230620-211300-8e2e2da
stdlibCryptoVersion=2.4.0-20230620-202300-53ac3fb
stdlibTimeVersion=2.3.0-20230620-192500-12d3432
stdlibMimeVersion=2.8.0-20230620-205000-a1e0453
stdlibOsVersion=1.7.0-20230620-202800-f75dd63
stdlibTaskVersion=2.4.0-20230620-204200-bd8329a
stdlibJwtVersion=2.9.0-20230620-221100-adcdde4
stdlibGrpcVersion=1.9.0-20230622-103300-e35bf3c
stdlibOAuth2Version=2.9.0-20230620-214300-9df2b5a
stdlibUuidVersion=1.6.0-20230620-211300-6fdbff8
stdlibGraphqlVersion=1.9.0-20230622-112800-0ade7bc
stdlibUrlVersion=2.3.0-20230620-193100-90b6489
stdlibWebsubVersion=2.9.0-20230622-084100-c86e0c6
stdlibWebsubhubVersion=1.9.0-20230622-083000-02e28c8
observeVersion=1.1.0-20230620-193900-57e0c73
observeInternalVersion=1.1.0-20230620-201800-18bbd1b
stdlibCacheVersion=3.6.0
stdlibCryptoVersion=2.4.0
stdlibTimeVersion=2.3.0
stdlibMimeVersion=2.8.0
stdlibOsVersion=1.7.0
stdlibTaskVersion=2.4.0
stdlibJwtVersion=2.9.0
stdlibGrpcVersion=1.9.1-20230713-123300-63ff34b
stdlibOAuth2Version=2.9.0
stdlibUuidVersion=1.6.0
stdlibGraphqlVersion=1.9.1-20230718-143100-61e0270
stdlibUrlVersion=2.3.0
stdlibWebsubVersion=2.9.1-20230718-131800-20e8839
stdlibWebsubhubVersion=1.9.1-20230718-131300-fd1b2f7
observeVersion=1.1.0
observeInternalVersion=1.1.0
ballerinaGradlePluginVersion=2.0.0

0 comments on commit 2dacf33

Please sign in to comment.