Skip to content

Commit

Permalink
✨ Add Discovery addons and tasks (minio#341)
Browse files Browse the repository at this point in the history
See also:

konveyor/tackle2-addon-analyzer#99
konveyor/tackle2-hub#671

---------

Signed-off-by: Sam Lucidi <slucidi@redhat.com>
  • Loading branch information
mansam authored Jun 21, 2024
1 parent f52fdad commit 1b17156
Show file tree
Hide file tree
Showing 10 changed files with 203 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ jobs:
image: konveyor/tackle-keycloak-init
- repo: konveyor/kantra
image: konveyor/kantra
- repo: konveyor/tackle2-addon-discovery
image: konveyor/tackle2-addon-discovery
fail-fast: true
steps:
- uses: konveyor/release-tools/create-release@main
Expand Down
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=konveyor-operator
LABEL operators.operatorframework.io.bundle.channels.v1=development
LABEL operators.operatorframework.io.bundle.channel.default.v1=development
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.2
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.1
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=ansible.sdk.operatorframework.io/v1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
categories: Modernization & Migration
certified: "false"
containerImage: quay.io/konveyor/tackle2-operator:latest
createdAt: "2024-06-21T13:13:06Z"
createdAt: "2024-06-21T13:51:01Z"
description: Konveyor is an open-source application modernization platform that
helps organizations safely and predictably modernize applications to Kubernetes
at scale.
Expand Down
2 changes: 1 addition & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ images:
addon_analyzer: quay.io/konveyor/tackle2-addon-analyzer:latest
addon_discovery: quay.io/konveyor/tackle2-addon-discovery:latest
provider_generic: quay.io/konveyor/generic-external-provider:latest
provider_java: quay.io/konveyor/java-external-provider:latest
provider_java: quay.io/konveyor/java-external-provider:latest
21 changes: 21 additions & 0 deletions roles/tackle/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ feature_auth_required: "{{ false if app_profile == 'konveyor' else true }}"
feature_auth_type: keycloak
feature_isolate_namespace: true
feature_analysis_archiver: true
feature_discovery: true

# Environment
openshift_cluster: false
Expand Down Expand Up @@ -180,6 +181,26 @@ provider_java_image_fqin: "{{ lookup('env', 'RELATED_IMAGE_PROVIDER_JAVA') }}"
provider_java_name: "java"
provider_java_service_name: "{{ app_name }}-{{ provider_java_name }}-{{ analyzer_component_name }}"

language_discovery_fqin: "{{ lookup('env', 'RELATED_IMAGE_ADDON_DISCOVERY') }}"
language_discovery_name: "language-discovery"
language_discovery_component_name: "addon"
language_discovery_service_name: "{{ app_name }}-{{ language_discovery_name }}-{{ language_discovery_component_name }}"
language_discovery_container_limits_cpu: "500m"
language_discovery_container_limits_memory: "512Mi"
language_discovery_container_requests_cpu: "500m"
language_discovery_container_requests_memory: "512Mi"

tech_discovery_fqin: "{{ analyzer_fqin }}"
tech_discovery_name: "tech-discovery"
tech_discovery_component_name: "addon"
tech_discovery_service_name: "{{ app_name }}-{{ tech_discovery_name }}-{{ tech_discovery_component_name }}"
tech_discovery_container_limits_cpu: "{{ analyzer_container_limits_cpu }}"
tech_discovery_container_limits_memory: "{{ analyzer_container_limits_memory }}"
tech_discovery_container_requests_cpu: "{{ analyzer_container_requests_cpu }}"
tech_discovery_container_requests_memory: "{{ analyzer_container_requests_memory }}"
tech_discovery_provider_java_name: "discovery-java"
tech_discovery_provider_generic_name: "discovery-generic"

cache_name: "cache"
cache_data_volume_size: "100Gi"
cache_data_volume_name: "{{ app_name }}-{{ cache_name }}-data"
Expand Down
10 changes: 10 additions & 0 deletions roles/tackle/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,16 @@
state: present
definition: "{{ lookup('template', 'customresource-addon-analyzer.yml.j2') }}"

- name: "Create Language Discovery Addon CR"
k8s:
state: present
definition: "{{ lookup('template', 'customresource-addon-language-discovery.yml.j2') }}"

- name: "Create Tech Discovery Addon CR"
k8s:
state: present
definition: "{{ lookup('template', 'customresource-addon-tech-discovery.yml.j2') }}"

- name: "Create Network Policy"
k8s:
state: present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,4 @@ metadata:
name: {{ analyzer_name }}
spec:
priority: 10
dependencies: [ {{ language_discovery_name }} ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
kind: Addon
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
name: {{ language_discovery_name }}
namespace: {{ app_namespace }}
labels:
app.kubernetes.io/name: {{ language_discovery_service_name }}
app.kubernetes.io/component: {{ language_discovery_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
spec:
task: {{ language_discovery_name }}
container:
name: {{ language_discovery_component_name }}
image: {{ language_discovery_fqin }}
imagePullPolicy: {{ image_pull_policy }}
resources:
limits:
cpu: {{ language_discovery_container_limits_cpu }}
memory: {{ language_discovery_container_limits_memory }}
requests:
cpu: {{ language_discovery_container_requests_cpu }}
memory: {{ language_discovery_container_requests_memory }}
---
kind: Task
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
namespace: {{ app_namespace }}
name: {{ language_discovery_name }}
labels:
konveyor.io/discovery: "language"
spec:
priority: 10
data:
source: language-discovery
124 changes: 124 additions & 0 deletions roles/tackle/templates/customresource-addon-tech-discovery.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
kind: Addon
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
name: {{ tech_discovery_name }}
namespace: {{ app_namespace }}
labels:
app.kubernetes.io/name: {{ tech_discovery_service_name }}
app.kubernetes.io/component: {{ tech_discovery_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
spec:
task: {{ tech_discovery_name }}
container:
name: {{ tech_discovery_component_name }}
image: {{ tech_discovery_fqin }}
imagePullPolicy: {{ image_pull_policy }}
resources:
limits:
cpu: {{ tech_discovery_container_limits_cpu }}
memory: {{ tech_discovery_container_limits_memory }}
requests:
cpu: {{ tech_discovery_container_requests_cpu }}
memory: {{ tech_discovery_container_requests_memory }}
---
kind: Extension
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
name: {{ tech_discovery_provider_java_name }}
namespace: {{ app_namespace }}
labels:
app.kubernetes.io/name: {{ provider_java_service_name }}
app.kubernetes.io/component: {{ provider_java_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
spec:
addon: {{ tech_discovery_name }}
selector: tag:Language=Java || !tag:Language
container:
name: {{ provider_java_name }}
image: {{ provider_java_image_fqin }}
imagePullPolicy: {{ image_pull_policy }}
args:
- --port
- $(PORT)
env:
- name: PORT
value: ${seq:8000}
resources:
limits:
cpu: {{ provider_java_container_limits_cpu }}
memory: {{ provider_java_container_limits_memory }}
requests:
cpu: {{ provider_java_container_requests_cpu }}
memory: {{ provider_java_container_requests_memory }}
metadata:
resources:
- selector: identity:kind=maven
fields:
- name: settings
path: /shared/creds/maven/settings.xml
key: maven.settings.path
provider:
name: {{ provider_java_name }}
address: localhost:$(PORT)
initConfig:
- providerSpecificConfig:
bundles: /jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar
depOpenSourceLabelsFile: /usr/local/etc/maven.default.index
lspServerPath: /jdtls/bin/jdtls
mavenSettingsFile: $(maven.settings.path)
---
kind: Extension
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
name: {{ tech_discovery_provider_generic_name }}
namespace: {{ app_namespace }}
labels:
app.kubernetes.io/name: {{ provider_generic_service_name }}
app.kubernetes.io/component: {{ provider_generic_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
spec:
addon: {{ tech_discovery_name }}
selector: tag:Language=Golang || tag:Language=Python
container:
name: {{ provider_generic_name }}
image: {{ provider_generic_image_fqin }}
imagePullPolicy: {{ image_pull_policy }}
args:
- --port
- $(PORT)
env:
- name: PORT
value: ${seq:8000}
resources:
limits:
cpu: {{ provider_generic_container_limits_cpu }}
memory: {{ provider_generic_container_limits_memory }}
requests:
cpu: {{ provider_generic_container_requests_cpu }}
memory: {{ provider_generic_container_requests_memory }}
metadata:
provider:
name: {{ provider_generic_name }}
address: localhost:$(PORT)
initConfig:
---
kind: Task
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
namespace: {{ app_namespace }}
name: {{ tech_discovery_name }}
labels:
konveyor.io/discovery: "technology"
spec:
priority: 10
dependencies: [ {{ language_discovery_name }} ]
data:
mode:
discovery: true
tagger:
enabled: true
source: tech-discovery
rules:
labels:
included: ["discovery"]
7 changes: 7 additions & 0 deletions roles/tackle/templates/deployment-hub.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ spec:
{% else %}
- name: ANALYSIS_ARCHIVER_ENABLED
value: "false"
{% endif %}
{% if feature_discovery|bool %}
- name: DISCOVERY_ENABLED
value: "true"
{% else %}
- name: DISCOVERY_ENABLED
value: "false"
{% endif %}
ports:
- containerPort: {{ hub_port }}
Expand Down

0 comments on commit 1b17156

Please sign in to comment.