-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.6.0' into main
- Loading branch information
Showing
314 changed files
with
5,721 additions
and
1,974 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
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 |
---|---|---|
|
@@ -15,14 +15,6 @@ jobs: | |
java-version: '11' | ||
architecture: 'x64' | ||
|
||
- name: Mount bazel cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
/home/runner/.cache/bazel | ||
/home/runner/.cache/bazel_external | ||
key: bazel | ||
|
||
- name: Install bazelisk | ||
run: | | ||
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64" | ||
|
@@ -32,9 +24,13 @@ jobs: | |
- name: Enable CI settings | ||
run: | | ||
echo "$GCS_SA_KEY" > key.json | ||
cat <<EOF >>.bazelrc | ||
common --config=ci | ||
build:ci --google_credentials=key.json | ||
EOF | ||
env: | ||
GCS_SA_KEY: ${{secrets.GCS_SA_KEY}} | ||
|
||
- name: Lint | ||
run: | | ||
|
@@ -53,3 +49,16 @@ jobs: | |
run: | | ||
echo ${{ secrets.PAT }} | docker login ghcr.io -u airydevci --password-stdin | ||
./scripts/push-images.sh ${{ github.ref }} | ||
- name: Install aws cli | ||
uses: chrislennon/[email protected] | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | ||
- name: Upload airy binary to S3 | ||
if: startsWith(github.ref, 'refs/heads/release') || startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/develop') | ||
run: | | ||
aws s3 cp bazel-bin/infrastructure/cli/airy_linux_bin s3://airy-core-binaries/`cat ./VERSION`/linux/amd64/airy | ||
aws s3 cp bazel-bin/infrastructure/cli/airy_darwin_bin s3://airy-core-binaries/`cat ./VERSION`/darwin/amd64/airy | ||
aws s3 cp bazel-bin/infrastructure/cli/airy_windows_bin s3://airy-core-binaries/`cat ./VERSION`/windows/amd64/airy.exe | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
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
14 changes: 6 additions & 8 deletions
14
...ain/java/co/airy/core/media/Resolver.java → .ijwb/.idea/fileTemplates/Stream App.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 +1 @@ | ||
0.5.0 | ||
0.6.0 |
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
25 changes: 25 additions & 0 deletions
25
backend/api/admin/src/main/java/co/airy/core/api/config/ClientConfigController.java
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package co.airy.core.api.config; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@RestController | ||
public class ClientConfigController { | ||
private final ServiceDiscovery serviceDiscovery; | ||
|
||
public ClientConfigController(ServiceDiscovery serviceDiscovery) { | ||
this.serviceDiscovery = serviceDiscovery; | ||
} | ||
|
||
@PostMapping("/client.config") | ||
public ResponseEntity<ClientConfigResponsePayload> getConfig() { | ||
return ResponseEntity.ok(ClientConfigResponsePayload.builder() | ||
.components(serviceDiscovery.getComponents()) | ||
.features(Map.of()) | ||
.build()); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
backend/api/admin/src/main/java/co/airy/core/api/config/ClientConfigResponsePayload.java
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package co.airy.core.api.config; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.Map; | ||
|
||
@Builder | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ClientConfigResponsePayload { | ||
private Map<String, Map<String, Object>> components; | ||
private Map<String, String> features; | ||
} |
15 changes: 15 additions & 0 deletions
15
backend/api/admin/src/main/java/co/airy/core/api/config/ClientControllerConfig.java
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package co.airy.core.api.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.annotation.EnableScheduling; | ||
import org.springframework.web.client.RestTemplate; | ||
|
||
@EnableScheduling | ||
@Configuration | ||
public class ClientControllerConfig { | ||
@Bean | ||
public RestTemplate restTemplate() { | ||
return new RestTemplate(); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
backend/api/admin/src/main/java/co/airy/core/api/config/ServiceDiscovery.java
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package co.airy.core.api.config; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.http.HttpMethod; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.scheduling.annotation.Async; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.client.RestTemplate; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
@Component | ||
public class ServiceDiscovery { | ||
private final String namespace; | ||
private final RestTemplate restTemplate; | ||
|
||
private final Map<String, Map<String, Object>> components = new ConcurrentHashMap<>(); | ||
|
||
private static final List<String> services = List.of( | ||
"sources-chatplugin", | ||
"sources-facebook-connector", | ||
"sources-twilio-connector", | ||
"sources-google-connector" | ||
); | ||
|
||
public ServiceDiscovery(@Value("${kubernetes.namespace}") String namespace, RestTemplate restTemplate) { | ||
this.namespace = namespace; | ||
this.restTemplate = restTemplate; | ||
} | ||
|
||
public Map<String, Map<String, Object>> getComponents() { | ||
return components; | ||
} | ||
|
||
@Scheduled(fixedRate = 1_000) | ||
private void updateComponentsStatus() { | ||
for (String service : services) { | ||
try { | ||
ResponseEntity<Object> response = restTemplate.exchange(String.format("http://%s.%s/actuator/health", service, namespace), HttpMethod.GET, null, Object.class); | ||
components.put(service.replace("-connector", ""), Map.of("enabled", response.getStatusCode().is2xxSuccessful())); | ||
} catch (Exception e) { | ||
components.put(service.replace("-connector", ""), Map.of("enabled",false)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.