diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..9bf60391349 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM mcr.microsoft.com/devcontainers/go:1-1.22-bookworm + +ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib:/usr/local/lib/pkgconfig +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib +ENV DEVLAKE_PLUGINS=bamboo,bitbucket,circleci,customize,dora,gitextractor,github,github_graphql,gitlab,jenkins,jira,org,pagerduty,refdiff,slack,sonarqube,trello,webhook + +RUN apt-get update -y +RUN apt-get install pkg-config python3-dev default-libmysqlclient-dev build-essential libpq-dev cmake -y +RUN git clone -b v1.3.0 https://github.com/libgit2/libgit2.git && cd libgit2 && mkdir build && cd build && cmake .. && make && make install diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..a9e43722772 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +{ + "name": "Go", + "dockerComposeFile": "docker-compose.yml", + "service": "devcontainer", + "workspaceFolder": "/workspace", + "features": { + "ghcr.io/jungaretti/features/make:1": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2.12.0": {}, + "ghcr.io/devcontainers/features/python:1": { + "version": "3.9" + }, + "ghcr.io/devcontainers-extra/features/poetry:2": {}, + "ghcr.io/devcontainers/features/node:1": { + "version": "18" + } + }, + "forwardPorts": [ + 4000, + 8080 + ], + "postCreateCommand": "npm install commitizen -g", + "customizations": { + "vscode": { + "extensions": [ + "streetsidesoftware.code-spell-checker" + ] + } + }, + "remoteUser": "root" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 00000000000..0246b94536e --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,64 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: '3.8' +services: + devcontainer: + build: + dockerfile: Dockerfile + volumes: + - ..:/workspace + networks: + - default + command: sleep infinity + mysql: + image: mysql:8 + volumes: + - mysql-storage:/var/lib/mysql + restart: always + ports: + - 3306:3306 + environment: + MYSQL_ROOT_PASSWORD: admin + MYSQL_DATABASE: lake + MYSQL_USER: merico + MYSQL_PASSWORD: merico + TZ: UTC + command: --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-log-bin + networks: + - default + grafana: + image: devlake.docker.scarf.sh/apache/devlake-dashboard:latest + ports: + - 3002:3000 + volumes: + - grafana-storage:/var/lib/grafana + environment: + GF_SERVER_ROOT_URL: "http://localhost:4000/grafana" + GF_USERS_DEFAULT_THEME: "light" + MYSQL_URL: mysql:3306 + MYSQL_DATABASE: lake + MYSQL_USER: merico + MYSQL_PASSWORD: merico + TZ: UTC + restart: always + depends_on: + - mysql + networks: + - default + +volumes: + mysql-storage: + grafana-storage: diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh new file mode 100644 index 00000000000..6350b63dd99 --- /dev/null +++ b/.devcontainer/post-install.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +make dep +npm install commitizen -g diff --git a/config-ui/package.json b/config-ui/package.json index 9a69135161b..8c70b92677d 100644 --- a/config-ui/package.json +++ b/config-ui/package.json @@ -5,7 +5,7 @@ "packageManager": "yarn@3.4.1", "type": "module", "scripts": { - "start": "vite", + "start": "vite --host", "build": "vite build", "preview": "vite preview", "lint": "tsc && eslint . --fix",