Skip to content

Commit

Permalink
Merge branch 'linkedin:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 authored Jan 3, 2022
2 parents 2a9370a + 83d6eef commit 5fd662d
Show file tree
Hide file tree
Showing 80 changed files with 3,310 additions and 541 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ project.ext.externalDependency = [
'hadoopMapreduceClient':'org.apache.hadoop:hadoop-mapreduce-client-core:2.7.2',
'hibernateCore': 'org.hibernate:hibernate-core:5.2.16.Final',
'httpClient': 'org.apache.httpcomponents:httpclient:4.5.9',
'httpAsyncClient': 'org.apache.httpcomponents:httpasyncclient:4.1.5',
'iStackCommons': 'com.sun.istack:istack-commons-runtime:4.0.1',
'jacksonCore': 'com.fasterxml.jackson.core:jackson-core:2.9.10',
'jacksonDataBind': 'com.fasterxml.jackson.core:jackson-databind:2.9.10.7',
Expand All @@ -94,6 +95,8 @@ project.ext.externalDependency = [
'mavenArtifact': "org.apache.maven:maven-artifact:$mavenVersion",
'mockito': 'org.mockito:mockito-core:3.0.0',
'mockitoInline': 'org.mockito:mockito-inline:3.0.0',
'mockServer': 'org.mock-server:mockserver-netty:5.11.2',
'mockServerClient': 'org.mock-server:mockserver-client-java:5.11.2',
'mysqlConnector': 'mysql:mysql-connector-java:8.0.20',
'neo4jHarness': 'org.neo4j.test:neo4j-harness:3.4.11',
'neo4jJavaDriver': 'org.neo4j.driver:neo4j-java-driver:4.0.1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const Header = styled.div`
border-bottom: 1px solid ${ANTD_GRAY[4.5]};
padding: 20px 20px 0 20px;
flex-shrink: 0;
height: 137px;
min-height: 137px;
`;

const TabContent = styled.div`
Expand Down
95 changes: 95 additions & 0 deletions datahub-web-react/src/app/home/GettingStartedModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import React from 'react';
import styled from 'styled-components';

import { Divider, Image, Modal, Steps, Typography } from 'antd';
import pipinstall from '../../images/pipinstall.png';
import recipeExample from '../../images/recipe-example.png';
import ingestExample from '../../images/ingest-example.png';

const StyledModal = styled(Modal)`
top: 20px;
`;

const StepImage = styled(Image)`
width: auto;
object-fit: contain;
margin-right: 10px;
background-color: transparent;
border-radius: 8px;
`;

const GettingStartedParagraph = styled(Typography.Paragraph)`
font-size: 14px;
&& {
margin-bottom: 28px;
}
`;

type Props = {
visible: boolean;
onClose: () => void;
};

export const GettingStartedModal = ({ visible, onClose }: Props) => {
return (
<StyledModal onCancel={onClose} width={800} visible={visible} footer={null}>
<Typography.Title level={3}>Welcome to DataHub</Typography.Title>
<Divider />
<Typography.Title level={5}>Getting Started</Typography.Title>
<GettingStartedParagraph>
It looks like you&apos;re new to DataHub - Welcome! To start ingesting metadata, follow these steps or
check out the full{' '}
<a href="https://datahubproject.io/docs/metadata-ingestion" target="_blank" rel="noreferrer">
Metadata Ingestion Quickstart Guide.
</a>
</GettingStartedParagraph>
<Steps current={-1} direction="vertical">
<Steps.Step
title="Install the DataHub CLI"
description={
<>
<Typography.Paragraph>
From your command line, install the acryl-datahub package from PyPI.
</Typography.Paragraph>
<StepImage preview={false} height={52} src={pipinstall} />
</>
}
/>
<Steps.Step
title="Create a Recipe File"
description={
<>
<Typography.Paragraph>
Define a YAML file defining the source from which you wish to extract metadata. This is
where you&apos;ll tell DataHub how to connect to your data source and configure the
metadata to be extracted.
</Typography.Paragraph>
<StepImage preview={false} height={300} src={recipeExample} />
</>
}
/>
<Steps.Step
title="Run 'datahub ingest'"
description={
<>
<Typography.Paragraph>
Execute the datahub ingest command from your command line to ingest metadata into
DataHub.
</Typography.Paragraph>
<StepImage preview={false} height={52} src={ingestExample} />
</>
}
/>
</Steps>
<Typography.Paragraph>
That&apos;s it! Once you&apos;ve ingested metadata, you can begin to search, document, tag, and assign
ownership for your data assets.
</Typography.Paragraph>
<Typography.Title level={5}>Still have questions?</Typography.Title>
<Typography.Paragraph>
Join our <a href="https://slack.datahubproject.io/">Slack</a> to ask questions, provide feedback and
more.
</Typography.Paragraph>
</StyledModal>
);
};
71 changes: 56 additions & 15 deletions datahub-web-react/src/app/home/HomePageRecommendations.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import { Divider, Typography } from 'antd';
import { Button, Divider, Empty, Typography } from 'antd';
import { RocketOutlined } from '@ant-design/icons';
import { RecommendationModule as RecommendationModuleType, ScenarioType } from '../../types.generated';
import { useListRecommendationsQuery } from '../../graphql/recommendations.generated';
import { RecommendationModule } from '../recommendations/RecommendationModule';
import { BrowseEntityCard } from '../search/BrowseEntityCard';
import { useEntityRegistry } from '../useEntityRegistry';
import { useGetEntityCountsQuery } from '../../graphql/app.generated';
import { GettingStartedModal } from './GettingStartedModal';
import { ANTD_GRAY } from '../entity/shared/constants';

const RecommendationsContainer = styled.div`
margin-top: 32px;
Expand Down Expand Up @@ -38,6 +41,22 @@ const BrowseCardContainer = styled.div`
flex-wrap: wrap;
`;

const ConnectSourcesButton = styled(Button)`
margin: 16px;
`;

const NoMetadataEmpty = styled(Empty)`
font-size: 18px;
color: ${ANTD_GRAY[8]};
`;

const NoMetadataContainer = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
`;

type Props = {
userUrn: string;
};
Expand All @@ -46,6 +65,7 @@ export const HomePageRecommendations = ({ userUrn }: Props) => {
// Entity Types
const entityRegistry = useEntityRegistry();
const browseEntityList = entityRegistry.getBrowseEntityTypes();
const [showGettingStartedModal, setShowGettingStartedModal] = useState(false);

const { data: entityCountData } = useGetEntityCountsQuery({
variables: {
Expand Down Expand Up @@ -75,25 +95,45 @@ export const HomePageRecommendations = ({ userUrn }: Props) => {
});
const recommendationModules = data?.listRecommendations?.modules;

// Determine whether metadata has been ingested yet.
const hasLoadedEntityCounts = orderedEntityCounts && orderedEntityCounts.length > 0;
const hasIngestedMetadata =
orderedEntityCounts && orderedEntityCounts.filter((entityCount) => entityCount.count > 0).length > 0;

useEffect(() => {
if (hasLoadedEntityCounts && !hasIngestedMetadata) {
setShowGettingStartedModal(true);
}
}, [hasLoadedEntityCounts, hasIngestedMetadata]);

return (
<RecommendationsContainer>
{orderedEntityCounts && orderedEntityCounts.length > 0 && (
<RecommendationContainer>
<RecommendationTitle level={4}>Explore your Metadata</RecommendationTitle>
<ThinDivider />
<BrowseCardContainer>
{orderedEntityCounts.map(
(entityCount) =>
entityCount &&
entityCount.count !== 0 && (
<BrowseEntityCard
key={entityCount.entityType}
entityType={entityCount.entityType}
count={entityCount.count}
/>
),
)}
</BrowseCardContainer>
{hasIngestedMetadata ? (
<BrowseCardContainer>
{orderedEntityCounts.map(
(entityCount) =>
entityCount &&
entityCount.count !== 0 && (
<BrowseEntityCard
key={entityCount.entityType}
entityType={entityCount.entityType}
count={entityCount.count}
/>
),
)}
</BrowseCardContainer>
) : (
<NoMetadataContainer>
<NoMetadataEmpty description="No Metadata Found 😢" />
<ConnectSourcesButton onClick={() => setShowGettingStartedModal(true)}>
<RocketOutlined /> Connect your data sources
</ConnectSourcesButton>
</NoMetadataContainer>
)}
</RecommendationContainer>
)}
{recommendationModules &&
Expand All @@ -109,6 +149,7 @@ export const HomePageRecommendations = ({ userUrn }: Props) => {
/>
</RecommendationContainer>
))}
<GettingStartedModal onClose={() => setShowGettingStartedModal(false)} visible={showGettingStartedModal} />
</RecommendationsContainer>
);
};
11 changes: 8 additions & 3 deletions datahub-web-react/src/conf/theme/theme_light.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,22 @@
"menu": {
"items": [
{
"label": "DataHub Project",
"label": "Project",
"path": "https://datahubproject.io",
"shouldOpenInNewTab": true
},
{
"label": "DataHub Docs",
"label": "Docs",
"path": "https://datahubproject.io/docs",
"shouldOpenInNewTab": true
},
{
"label": "DataHub GitHub",
"label": "Releases",
"path": "https://datahubproject.io/docs/releases/",
"shouldOpenInNewTab": true
},
{
"label": "GitHub",
"path": "https://github.com/linkedin/datahub",
"shouldOpenInNewTab": true
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added datahub-web-react/src/images/pipinstall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added datahub-web-react/src/images/recipe-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
APP_ENV: dev
volumes:
- ./elasticsearch-setup/create-indices.sh:/create-indices.sh
- ../metadata-service/restli-impl/src/main/resources/index/:/index
- ../metadata-service/restli-servlet-impl/src/main/resources/index/:/index

kafka-setup:
image: linkedin/datahub-kafka-setup:debug
Expand Down
7 changes: 7 additions & 0 deletions docs-website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ module.exports = {
{
Sinks: list_ids_in_directory("metadata-ingestion/sink_docs"),
},
{
"Custom Integrations": [
"metadata-ingestion/as-a-library",
"metadata-integration/java/as-a-library",
],
},
{
Scheduling: [
"metadata-ingestion/schedule_docs/intro",
Expand Down Expand Up @@ -209,6 +215,7 @@ module.exports = {
"docs/how/auth/sso/configure-oidc-react",
"docs/how/auth/sso/configure-oidc-react-google",
"docs/how/auth/sso/configure-oidc-react-okta",
"docs/how/auth/sso/configure-oidc-react-azure",
"docs/how/restore-indices",
"docs/how/extract-container-logs",
"docs/how/delete-metadata",
Expand Down
2 changes: 1 addition & 1 deletion docs/docker/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ applies.
### Unexpected character

If you are using Windows WSL (with Ubuntu) and receive an error of 'unexpected character "." in variable name...' while executing `docker/dev.sh` try these steps:
- Open up Docker Desktop, click gear icon at top to open the settings and uncheck the "Use Docker Compose V2" option. Close your terminal, open a new one and try to rerun the command `docker/dev.sh`.
- Open up Docker Desktop, click gear icon at top to open the settings and uncheck the "Use Docker Compose V2" option. Close your terminal, open a new one and try to rerun the command `docker/dev.sh`. In some cases, unchecking the box may not be sufficient, if the problem persists try executing `docker-compose disable-v2` from your terminal.
- Next, try `sudo docker/dev.sh` and finally, try moving the file `~/.docker/config.json` to `~/.docker/config.json.bak` and retry the command with `sudo`.

### Running a specific service
Expand Down
Loading

0 comments on commit 5fd662d

Please sign in to comment.