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

Automate Docker deployment for FOSSLight Scanner using GitHub Actions #114

Closed
wants to merge 53 commits into from

Conversation

soonhong99
Copy link
Contributor

@soonhong99 soonhong99 commented Aug 23, 2024

Description

This PR implements automated Docker deployment for FOSSLight Scanner using GitHub Actions and can use output, input path without using volume mount command.

Changes

Add new GitHub Actions workflow for Docker deployment
Use release tag as Docker image version
Automate build and push to Docker Hub
before when we run dockerfile with use option -p [path], we have to volume mount in my docker image
but now, we can run docker file without volume mount. only using our local path with dockerRun.sh

Benefits

Streamlines the deployment process
Ensures consistency between GitHub releases and Docker image versions
Reduces manual intervention in the deployment pipeline
Improves overall reliability of the deployment process
user can run docker image like applications

Testing

Verified workflow triggers correctly on new releases
Confirmed Docker image builds successfully in Docker hub with tag: latest, release version
Tested Docker image pull to your Docker Desktop
Validated Docker image versioning matches release tags

if you want to use docker image without volume mount procedure, then u can use dockerRun.sh

this shell script in this root. if you want to execute, write command like this: chmod +x dockerRun.sh

then you can run dockerfile without volume mount like this: ./dockerRun.sh -i fosslight_submit -o result_dir -w "https://github.com/LGE-OSS/example.git"

result_dir mean that is your result dir. this dir must place in your local. if you don't, then result will be created in your execute file.

you have to use -i option. because if you dont use it, then you can't run your docker image.

and i also make -m option. this option is same like in fosslight [mode].

you can select mode within this range: all, source, dependency, binary, compare.

why use dockerRun.sh and entrypoint.sh?

this shell script is wrapper script. to hide action about docker volume mount.
if you have more intelligent idea, please comment.

Additional Notes

Requires Docker Hub credentials to be set as GitHub secrets
May need to update documentation to reflect new deployment process

Please review and provide feedback. Let me know if any additional changes or information are needed.

Type of change

Please insert 'x' one of the type of change.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Refactoring, Maintenance
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

soimkim and others added 30 commits August 13, 2024 00:41
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: yongjunhong <kevin0928@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: yongjunhong <kevin0928@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
…json

Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
…lish yml change name

Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
@soonhong99
Copy link
Contributor Author

dockerfile 및 docker-publish.yml 파일만 수정하였습니다. 중간에 있는 commit 들은 test용이었는데 다 들어갔네요..
PR하고 보니 docker publish yml 파일에서 tag를 사용자에 맞게 수정되게 하는 동적인 작업으로 변경해야할 것 같네요

@soonhong99
Copy link
Contributor Author

bump version error는 해결했으나 pypi fosslight-scanner에 올리는 deploy 과정에서 에러가 발생했습니다.
해당 문제는 제가 권한이 없기 때문에 생기는 자연적인? 오류인 것 같다고 판단했습니다.

@soimkim soimkim added the chore [PR/Issue] Refactoring, maintenance the code label Aug 25, 2024
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
@soonhong99
Copy link
Contributor Author

https://www.notion.so/fosslight/docker-run-application-5ac7727129394855b32265c13e12a87b?pvs=4#b9d576368f68467b8427e88aa6f296f5
노션에 한국어로 실행과정 및 왜 코드를 이렇게 구현했는지에 대한 설명 보충해놓았습니다.

publish-release.yml 파일은 제가 fork받은 repo에서도 pypi 및 버전 업그레이드 될 수 있게끔 구현 하였지만 기존 publish-release.yml파일로도 fosslight에서 문제없이 실행되었기 때문에 고치지 않았습니다.

soonhong99 and others added 5 commits September 10, 2024 14:25
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <nanayah99@naver.com>
Signed-off-by: soonhong99 <67502252+soonhong99@users.noreply.github.com>
…olume mount

Signed-off-by: soonhong99 <67502252+soonhong99@users.noreply.github.com>
@soonhong99
Copy link
Contributor Author

현재 수리중에 있습니다.. 뚝딱뚝딱..

* feat: Create a wrapper script to simplify Docker run command with
  volume mounting
  * docs: Include usage instructions for the wrapper script
  * refactor: Adjust Docker-related scripts for better Windows
    compatibility

    Signed-off-by: Your Name <your.email@example.com>
Signed-off-by: soonhong99 <67502252+soonhong99@users.noreply.github.com>
* additional option added

Signed-off-by: soonhong99 <67502252+soonhong99@users.noreply.github.com>
Signed-off-by: soonhong99 <67502252+soonhong99@users.noreply.github.com>
Signed-off-by: soonhong99 <67502252+soonhong99@users.noreply.github.com>
Signed-off-by: soonhong99 <67502252+soonhong99@users.noreply.github.com>
@soimkim soimkim marked this pull request as draft September 22, 2024 05:38
@soonhong99 soonhong99 closed this Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore [PR/Issue] Refactoring, maintenance the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants