Skip to content

Commit 728af70

Browse files
Initial commit
fbshipit-source-id: 50c0a68e09e97ca7aae600e4073946c1e6c72968
0 parents  commit 728af70

242 files changed

Lines changed: 297481 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dynolog-ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: DYNOLOGCI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest] # TODO: What other OSs should we include here?
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Checkout submodules
21+
shell: bash
22+
run: |
23+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
24+
git submodule sync --recursive
25+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
26+
27+
- name: Get env vars
28+
run: |
29+
echo GITHUB_WORKFLOW = $GITHUB_WORKFLOW
30+
echo HOME = $HOME
31+
echo GITHUB_ACTION = $GITHUB_ACTION
32+
echo GITHUB_ACTIONS = $GITHUB_ACTIONS
33+
echo GITHUB_REPOSITORY = $GITHUB_REPOSITORY
34+
echo GITHUB_EVENT_NAME = $GITHUB_EVENT_NAME
35+
echo GITHUB_EVENT_PATH = $GITHUB_EVENT_PATH
36+
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
37+
echo GITHUB_SHA = $GITHUB_SHA
38+
echo GITHUB_REF = $GITHUB_REF
39+
c++ --verbose
40+
41+
- name: Download and setup Ninja
42+
uses: seanmiddleditch/gha-setup-ninja@master
43+
44+
- name: Build dynolog binary
45+
run: |
46+
set -e
47+
./scripts/build.sh
48+
- name: Run Unit Tests
49+
run: |
50+
set -e
51+
cd $GITHUB_WORKSPACE/build
52+
ctest --output-on-failure

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cargo.lock

.gitmodules

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[submodule "third_party/glog"]
2+
path = third_party/glog
3+
url = https://github.com/google/glog.git
4+
[submodule "third_party/gflags"]
5+
path = third_party/gflags
6+
url = https://github.com/gflags/gflags.git
7+
[submodule "third_party/fmt"]
8+
path = third_party/fmt
9+
url = https://github.com/fmtlib/fmt.git
10+
[submodule "third_party/json"]
11+
path = third_party/json
12+
url = https://github.com/nlohmann/json.git
13+
[submodule "third_party/pfs"]
14+
path = third_party/pfs
15+
url = https://github.com/dtrugman/pfs.git
16+
[submodule "third_party/googletest"]
17+
path = third_party/googletest
18+
url = https://github.com/google/googletest.git
19+
[submodule "third_party/range-v3"]
20+
path = third_party/range-v3
21+
url = https://github.com/ericniebler/range-v3.git
22+
[submodule "third_party/cpr"]
23+
path = third_party/cpr
24+
url = https://github.com/libcpr/cpr.git
25+
[submodule "third_party/DCGM"]
26+
path = third_party/DCGM
27+
url = https://github.com/NVIDIA/DCGM.git

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# July 28, 2022
2+
* Initial commit

CMakeLists.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
cmake_minimum_required(VERSION 3.20)
3+
4+
project(Dynolog VERSION 1.0)
5+
option(BUILD_TESTS "Build the unit tests" ON)
6+
option(USE_ODS_GRAPH_API "Enable logger to Meta ODS using public Graph API."
7+
ON)
8+
9+
set(CMAKE_VERBOSE_MAKEFILE ON)
10+
11+
set(CMAKE_CXX_STANDARD 17)
12+
set(CMAKE_CXX_STANDARD_REQUIRED True)
13+
set(CMAKE_POSITION_INDEPENDENT_CODE True)
14+
15+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
16+
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
17+
18+
if(BUILD_TESTS)
19+
enable_testing()
20+
add_subdirectory("third_party/googletest" "third_party/googletest")
21+
endif()
22+
23+
include_directories(".")
24+
add_subdirectory(dynolog)
25+
add_subdirectory(cli)
26+
# The following dummy depdendency ensures the cli is built
27+
add_dependencies(dynolog_lib dyno)
28+
add_subdirectory(hbt)
29+
30+
# Third party deps
31+
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
32+
set(BUILD_SAMPLES OFF CACHE BOOL "")
33+
set(BUILD_TEST OFF CACHE BOOL "")
34+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
35+
36+
set(BUILD_TESTING OFF CACHE BOOL "")
37+
set(WITH_GFLAGS OFF CACHE BOOL "")
38+
add_subdirectory(third_party/glog)
39+
target_link_libraries(dynolog_lib PUBLIC glog::glog)
40+
41+
set(GFLAGS_BUILD_TESTING OFF CACHE BOOL "")
42+
add_subdirectory(third_party/gflags)
43+
target_link_libraries(dynolog_lib PUBLIC gflags::gflags)
44+
45+
# https://github.com/nlohmann/json#cmake
46+
set(JSON_BuildTests OFF CACHE INTERNAL "")
47+
add_subdirectory(third_party/json)
48+
target_link_libraries(dynolog_lib PUBLIC nlohmann_json::nlohmann_json)
49+
50+
add_subdirectory(third_party/pfs)
51+
target_include_directories(dynolog_lib PUBLIC third_party/pfs/include)
52+
target_link_libraries(dynolog_lib PUBLIC pfs)
53+
54+
add_subdirectory(third_party/fmt)
55+
target_link_libraries(dynolog_lib PUBLIC fmt::fmt)
56+
57+
set(BUILD_SAMPLES OFF CACHE BOOL "")
58+
add_subdirectory(third_party/range-v3)
59+
60+
if(USE_ODS_GRAPH_API)
61+
add_subdirectory(third_party/cpr)
62+
target_link_libraries(dynolog_lib PUBLIC cpr::cpr)
63+
endif()

CODE_OF_CONDUCT.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
This Code of Conduct also applies outside the project spaces when there is a
56+
reasonable belief that an individual's behavior may have a negative impact on
57+
the project or its community.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported by contacting the project team at <opensource-conduct@fb.com>. All
63+
complaints will be reviewed and investigated and will result in a response that
64+
is deemed necessary and appropriate to the circumstances. The project team is
65+
obligated to maintain confidentiality with regard to the reporter of an incident.
66+
Further details of specific enforcement policies may be posted separately.
67+
68+
Project maintainers who do not follow or enforce the Code of Conduct in good
69+
faith may face temporary or permanent repercussions as determined by other
70+
members of the project's leadership.
71+
72+
## Attribution
73+
74+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
75+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
76+
77+
[homepage]: https://www.contributor-covenant.org
78+
79+
For answers to common questions about this code of conduct, see
80+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing to dynolog
2+
We want to make contributing to this project as easy and transparent as
3+
possible.
4+
5+
## Our Development Process
6+
Each pull request is first submitted into Meta's internal repositories by a Meta team member. Once the commit has successfully passed Meta's internal test suite, it will be exported back out from Meta's repository. We endeavour to do this as soon as possible for all commits.
7+
8+
## Pull Requests
9+
We actively welcome your pull requests.
10+
11+
1. Fork the repo and create your branch from `main`.
12+
2. If you've added code that should be tested, add tests.
13+
3. If you've changed APIs, update the documentation.
14+
4. Ensure the test suite passes.
15+
5. Make sure your code lints.
16+
6. If you haven't already, complete the Contributor License Agreement ("CLA").
17+
18+
## Contributor License Agreement ("CLA")
19+
In order to accept your pull request, we need you to submit a CLA. You only need
20+
to do this once to work on any of Meta's open source projects.
21+
22+
Complete your CLA here: <https://code.facebook.com/cla>
23+
24+
## Issues
25+
We use GitHub issues to track public bugs. Please ensure your description is
26+
clear and has sufficient instructions to be able to reproduce the issue.
27+
28+
Meta has a [bounty program](https://www.facebook.com/whitehat/) for the safe
29+
disclosure of security bugs. In those cases, please go through the process
30+
outlined on that page and do not file a public issue.
31+
32+
## Coding Style
33+
* 2 spaces for indentation rather than tabs
34+
* 80 character line length
35+
* ...
36+
37+
## License
38+
By contributing to dynolog, you agree that your contributions will be licensed
39+
under the LICENSE file in the root directory of this source tree.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Facebook, Inc. and its affiliates.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)