Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support docker use the auth when starting #2403

Merged
merged 15 commits into from
Jan 15, 2024

Conversation

aroundabout
Copy link
Contributor

@aroundabout aroundabout commented Dec 26, 2023

Purpose of the PR

Todo

Main Changes

  • allow user to set env for docker to set auth mode
  • download keystore when package
  • fix a curl error ( also use curl first in function download )

Verifying these changes

  • allow user to set env for docker to set auth mode
    use the yaml below
version: '3'
services:
  server:
    #image: hugegraph/hugegraph
    image: dandelionivy/server
    container_name: graph
    ports:
      - 8080:8080
    environment:
      - AUTH=true
      - PASSWORD=123456
docker-compose up -d

visit http://localhost:8080/swagger-ui/index.html#/
set the user admin and password 123456 and use the ArthasAPI
image

  • download keystore when package
mvn package -DskipTests

and you can see
image

  • fix a curl error (also use curl first in function download)
    copy the download function and run:
function command_available() {
    local cmd=$1
    if [[ -x "$(command -v "$cmd")" ]]; then
        return 0
    else
        return 1
    fi
}
function download() {
    local path='./conf'
    local link_url='https://github.com/apache/hugegraph-doc/raw/binary-1.0/dist/server/hugegraph-server.keystore'
    if command_available "curl"; then
        if [ ! -d "$path" ]; then
            mkdir -p "$path" || {
                echo "Failed to create directory: $path"
                exit 1
            }
        fi
        curl -L "${link_url}" -o "${path}/$(basename "${link_url}")"
    else
        echo "curl or command_available is not available"
    fi
}
download
  • fix a curl no error message error
    I cannot repeat error that we cannot curl from localhost:8080, insteat i change the line 108 in start-hugegraph.sh and run bin/start-hugegraph.sh
    image
    and i get the result:
    image

Does this PR potentially affect the following parts?

  • Nope
  • Dependencies (add/update license info)
  • Modify configurations
  • The public API
  • Other affects (typed here)

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. feature New feature labels Dec 26, 2023
Copy link

codecov bot commented Dec 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7635c67) 65.59% compared to head (a242d34) 59.46%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2403      +/-   ##
============================================
- Coverage     65.59%   59.46%   -6.13%     
- Complexity      587      800     +213     
============================================
  Files           511      511              
  Lines         42590    42595       +5     
  Branches       5941     5942       +1     
============================================
- Hits          27936    25331    -2605     
- Misses        11840    14634    +2794     
+ Partials       2814     2630     -184     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aroundabout aroundabout marked this pull request as draft January 2, 2024 08:05
@aroundabout aroundabout marked this pull request as ready for review January 3, 2024 06:21
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. ci-cd Build or deploy and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jan 3, 2024
Co-authored-by: imbajin <jin@apache.org>
@@ -16,9 +16,20 @@
# under the License.
#

curl --version >/dev/null 2>&1 ||
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove a redundant docker-entrypoint.sh, not move the file to download_keystore.sh

@aroundabout aroundabout requested a review from imbajin January 4, 2024 06:45
README.md Outdated Show resolved Hide resolved
imbajin
imbajin previously approved these changes Jan 4, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 4, 2024
@@ -39,7 +39,7 @@ services:
retries: 3

cassandra:
image: cassandra:4
image: cassandra:3.11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we setback to the version 3.x?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2374
I remember we rollback cassandra to 3.11 and it is approved by one reviewer.
But i find the pr it suspend just now.
I will adjust the yaml with license together.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2374 I remember we rollback cassandra to 3.11 and it is approved by one reviewer. But i find the pr it suspend just now. I will adjust the yaml with license together.

the problem has been solved (temporarily?), so no need to rollback it for now~

imbajin
imbajin previously approved these changes Jan 9, 2024
Copy link
Member

@imbajin imbajin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have tested the new scripts for docker image?

@aroundabout
Copy link
Contributor Author

Have tested the new scripts for docker image?

Tested.
And I want to use ci to test the docker images, maybe create a new branch based on the hugegraph-test

@imbajin imbajin requested a review from simon824 January 9, 2024 10:22
@VGalaxies
Copy link
Contributor

@aroundabout Great work! I left some comments for you to check~

@VGalaxies VGalaxies merged commit de5904a into apache:master Jan 15, 2024
20 of 21 checks passed
VGalaxies pushed a commit that referenced this pull request Jan 15, 2024
- allow user to set env for docker to set auth mode
- download keystore when package
- fix a curl error (also use curl first in `function` download)

---------

Co-authored-by: imbajin <jin@apache.org>
aroundabout added a commit to aroundabout/incubator-hugegraph that referenced this pull request Jan 16, 2024
- allow user to set env for docker to set auth mode
- download keystore when package
- fix a curl error (also use curl first in `function` download)

---------

Co-authored-by: imbajin <jin@apache.org>
imbajin added a commit that referenced this pull request Jan 17, 2024
…n using docker image for 1.2.0 as #2403 (#2417)

- allow user to set env for docker to set auth mode
- download keystore when package
- fix a curl error (also use curl first in `function` download)

---------

Co-authored-by: imbajin <jin@apache.org>
Z-HUANT pushed a commit to Z-HUANT/incubator-hugegraph that referenced this pull request Jan 23, 2024
- allow user to set env for docker to set auth mode
- download keystore when package
- fix a curl error (also use curl first in `function` download)

---------

Co-authored-by: imbajin <jin@apache.org>
imbajin added a commit to apache/incubator-hugegraph-doc that referenced this pull request Feb 1, 2024
1. sync with [2403](apache/incubator-hugegraph#2403)
2. change the order of the changelogs (there is a small problem in the origin order), and make the weight larger so that we can set the weight for version 1.5.0 to 10-1=9, where 10 is the weight for 1.2.0
3. Put the relevant parts of docker first

---------

Co-authored-by: imbajin <jin@apache.org>
github-actions bot pushed a commit to apache/incubator-hugegraph-doc that referenced this pull request Feb 1, 2024
1. sync with [2403](apache/incubator-hugegraph#2403)
2. change the order of the changelogs (there is a small problem in the origin order), and make the weight larger so that we can set the weight for version 1.5.0 to 10-1=9, where 10 is the weight for 1.2.0
3. Put the relevant parts of docker first

---------

Co-authored-by: imbajin <jin@apache.org> d2b63d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cd Build or deploy feature New feature lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
3 participants