fix(nocode): fix no-code upgrade (#12494)

This commit is contained in:
david-leifker 2025-01-29 15:16:49 -06:00 committed by GitHub
parent d0af9d59aa
commit a35bfddba2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 41 additions and 0 deletions

View File

@ -152,6 +152,18 @@ task runRestoreIndicesUrn(type: Exec) {
bootJar.getArchiveFile().get(), "-u", "RestoreIndices", "-a", "batchSize=100", "-a", "urnBasedPagination=true" bootJar.getArchiveFile().get(), "-u", "RestoreIndices", "-a", "batchSize=100", "-a", "urnBasedPagination=true"
} }
task runNoCode(type: Exec) {
dependsOn bootJar
group = "Execution"
description = "Run the NoCodeDataMigration process locally."
environment "ENTITY_REGISTRY_CONFIG_PATH", "../metadata-models/src/main/resources/entity-registry.yml"
commandLine "java", "-agentlib:jdwp=transport=dt_socket,address=5003,server=y,suspend=n",
"-jar",
"-Dkafka.schemaRegistry.url=http://localhost:8080/schema-registry/api",
"-Dserver.port=8083",
bootJar.getArchiveFile().get(), "-u", "NoCodeDataMigration", "-a", "batchSize=100", "-a", "dbType=MYSQL"
}
docker { docker {
name "${docker_registry}/${docker_repo}:v${version}" name "${docker_registry}/${docker_repo}:v${version}"
version "v${version}" version "v${version}"

View File

@ -0,0 +1,21 @@
package com.linkedin.datahub.upgrade.config;
import com.linkedin.gms.factory.system_telemetry.OpenTelemetryBaseFactory;
import io.datahubproject.metadata.context.TraceContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class OpenTelemetryConfig extends OpenTelemetryBaseFactory {
@Override
protected String getApplicationComponent() {
return "datahub-upgrade";
}
@Bean
@Override
protected TraceContext traceContext() {
return super.traceContext();
}
}

View File

@ -10,6 +10,7 @@ import com.linkedin.datahub.upgrade.system.BlockingSystemUpgrade;
import com.linkedin.metadata.dao.throttle.NoOpSensor; import com.linkedin.metadata.dao.throttle.NoOpSensor;
import com.linkedin.metadata.dao.throttle.ThrottleSensor; import com.linkedin.metadata.dao.throttle.ThrottleSensor;
import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder; import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder;
import io.datahubproject.metadata.context.TraceContext;
import javax.inject.Named; import javax.inject.Named;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
@ -38,6 +39,8 @@ public class UpgradeCliApplicationTest extends AbstractTestNGSpringContextTests
@Autowired @Autowired
private ThrottleSensor kafkaThrottle; private ThrottleSensor kafkaThrottle;
@Autowired private TraceContext traceContext;
@Test @Test
public void testRestoreIndicesInit() { public void testRestoreIndicesInit() {
/* /*
@ -62,4 +65,9 @@ public class UpgradeCliApplicationTest extends AbstractTestNGSpringContextTests
assertEquals( assertEquals(
new NoOpSensor(), kafkaThrottle, "No kafka throttle controls expected in datahub-upgrade"); new NoOpSensor(), kafkaThrottle, "No kafka throttle controls expected in datahub-upgrade");
} }
@Test
public void testTraceContext() {
assertNotNull(traceContext);
}
} }