-
Notifications
You must be signed in to change notification settings - Fork 4
Add FDT Dockerfile for FDT and FDT Agent #23
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
Open
fixy
wants to merge
2
commits into
cmscaltech:master
Choose a base branch
from
fixy:add_fdt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: Docker Image Build For FDT Agent | ||
|
|
||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| buildtag: | ||
| description: "Build Tag" | ||
| default: "dev" | ||
| type: "string" | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| DOCKER_USER: ${{secrets.DOCKER_USER}} | ||
| DOCKER_REGISTRY: ${{secrets.DOCKER_REGS}} | ||
| DOCKER_SDN_USER: ${{secrets.DOCKER_SDN_USER}} | ||
| DOCKER_SDN_REGISTRY: ${{secrets.DOCKER_SDN_REGS}} | ||
| DOCKER_TIER2_USER: ${{secrets.DOCKER_TIER2_USER}} | ||
| DOCKER_TIER2_REGISTRY: ${{secrets.DOCKER_TIER2_REGS}} | ||
| IMAGE_NAME: "cmscaltech/fdt-agent" | ||
| BUILD_DIR: "cmscaltech-docker/fdt-agent" | ||
| steps: | ||
| - name: Checkout tools repo | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: cmscaltech/docker | ||
| path: cmscaltech-docker | ||
|
|
||
| - name: Login to First Docker Registry | ||
| id: dockerOne | ||
| if: always() | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{secrets.DOCKER_REGS}} | ||
| username: ${{secrets.DOCKER_USER}} | ||
| password: ${{secrets.DOCKER_PASSWORD}} | ||
|
|
||
| - name: Login to Second Docker Registry | ||
| id: dockerTwo | ||
| if: always() | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{secrets.DOCKER_SDN_REGS}} | ||
| username: ${{secrets.DOCKER_SDN_USER}} | ||
| password: ${{secrets.DOCKER_SDN_PASSWORD}} | ||
|
|
||
| - name: Login to Thrid Docker Registry | ||
| id: dockerThree | ||
| if: always() | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{secrets.DOCKER_TIER2_REGS}} | ||
| username: ${{secrets.DOCKER_TIER2_USER}} | ||
| password: ${{secrets.DOCKER_TIER2_PASSWORD}} | ||
|
|
||
| - name: Build Docker image | ||
| id: mainRun | ||
| if: always() && (steps.dockerOne.outcome == 'success' || steps.dockerTwo.outcome == 'success' || steps.dockerThree.outcome == 'success') | ||
| run: | | ||
| cd $BUILD_DIR | ||
| docker build . --file Dockerfile-agent \ | ||
| --tag $IMAGE_NAME:${{ github.event.inputs.buildtag }} \ | ||
| --tag $IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) \ | ||
| --tag $DOCKER_SDN_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }} \ | ||
| --tag $DOCKER_SDN_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) \ | ||
| --tag $DOCKER_TIER2_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }} \ | ||
| --tag $DOCKER_TIER2_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) | ||
|
|
||
| - name: Docker Push Image to first registry | ||
| if: always() && (steps.mainRun.outcome == 'success' && steps.dockerOne.outcome == 'success') | ||
| run: | | ||
| docker push $IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) | ||
| docker push $IMAGE_NAME:${{ github.event.inputs.buildtag }} | ||
|
|
||
| - name: Docker Push Image to second registry | ||
| if: always() && (steps.mainRun.outcome == 'success' && steps.dockerTwo.outcome == 'success') | ||
| run: | | ||
| docker push $DOCKER_SDN_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }} | ||
| docker push $DOCKER_SDN_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) | ||
|
|
||
| - name: Docker Push Image to third registry | ||
| if: always() && (steps.mainRun.outcome == 'success' && steps.dockerThree.outcome == 'success') | ||
| run: | | ||
| docker push $DOCKER_TIER2_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }} | ||
| docker push $DOCKER_TIER2_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: Docker Image Build For FDT Agent | ||
|
|
||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| buildtag: | ||
| description: "Build Tag" | ||
| default: "dev" | ||
| type: "string" | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| DOCKER_USER: ${{secrets.DOCKER_USER}} | ||
| DOCKER_REGISTRY: ${{secrets.DOCKER_REGS}} | ||
| DOCKER_SDN_USER: ${{secrets.DOCKER_SDN_USER}} | ||
| DOCKER_SDN_REGISTRY: ${{secrets.DOCKER_SDN_REGS}} | ||
| DOCKER_TIER2_USER: ${{secrets.DOCKER_TIER2_USER}} | ||
| DOCKER_TIER2_REGISTRY: ${{secrets.DOCKER_TIER2_REGS}} | ||
| IMAGE_NAME: "cmscaltech/fdt" | ||
| BUILD_DIR: "cmscaltech-docker/fdt" | ||
| steps: | ||
| - name: Checkout tools repo | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: cmscaltech/docker | ||
| path: cmscaltech-docker | ||
|
|
||
| - name: Login to First Docker Registry | ||
| id: dockerOne | ||
| if: always() | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{secrets.DOCKER_REGS}} | ||
| username: ${{secrets.DOCKER_USER}} | ||
| password: ${{secrets.DOCKER_PASSWORD}} | ||
|
|
||
| - name: Login to Second Docker Registry | ||
| id: dockerTwo | ||
| if: always() | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{secrets.DOCKER_SDN_REGS}} | ||
| username: ${{secrets.DOCKER_SDN_USER}} | ||
| password: ${{secrets.DOCKER_SDN_PASSWORD}} | ||
|
|
||
| - name: Login to Thrid Docker Registry | ||
| id: dockerThree | ||
| if: always() | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{secrets.DOCKER_TIER2_REGS}} | ||
| username: ${{secrets.DOCKER_TIER2_USER}} | ||
| password: ${{secrets.DOCKER_TIER2_PASSWORD}} | ||
|
|
||
| - name: Build Docker image | ||
| id: mainRun | ||
| if: always() && (steps.dockerOne.outcome == 'success' || steps.dockerTwo.outcome == 'success' || steps.dockerThree.outcome == 'success') | ||
| run: | | ||
| cd $BUILD_DIR | ||
| docker build . --file Dockerfile \ | ||
| --tag $IMAGE_NAME:${{ github.event.inputs.buildtag }} \ | ||
| --tag $IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) \ | ||
| --tag $DOCKER_SDN_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }} \ | ||
| --tag $DOCKER_SDN_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) \ | ||
| --tag $DOCKER_TIER2_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }} \ | ||
| --tag $DOCKER_TIER2_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) | ||
|
|
||
| - name: Docker Push Image to first registry | ||
| if: always() && (steps.mainRun.outcome == 'success' && steps.dockerOne.outcome == 'success') | ||
| run: | | ||
| docker push $IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) | ||
| docker push $IMAGE_NAME:${{ github.event.inputs.buildtag }} | ||
|
|
||
| - name: Docker Push Image to second registry | ||
| if: always() && (steps.mainRun.outcome == 'success' && steps.dockerTwo.outcome == 'success') | ||
| run: | | ||
| docker push $DOCKER_SDN_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }} | ||
| docker push $DOCKER_SDN_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) | ||
|
|
||
| - name: Docker Push Image to third registry | ||
| if: always() && (steps.mainRun.outcome == 'success' && steps.dockerThree.outcome == 'success') | ||
| run: | | ||
| docker push $DOCKER_TIER2_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }} | ||
| docker push $DOCKER_TIER2_REGISTRY/$IMAGE_NAME:${{ github.event.inputs.buildtag }}-$(date +%Y%m%d) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| FROM openjdk:11-jre-slim | ||
|
|
||
| ENV FDT_VERSION=0.26.3 | ||
| ENV FDT_HOME=/fdt | ||
| ENV FDT_JAR=${FDT_HOME}/fdt.jar | ||
|
|
||
| RUN mkdir -p ${FDT_HOME} \ | ||
| && curl -L https://github.com/fast-data-transfer/fdt/releases/download/${FDT_VERSION}/fdt.jar -o ${FDT_JAR} | ||
| # Expose the FDT default port | ||
| EXPOSE 54321 | ||
|
|
||
| WORKDIR ${FDT_HOME} | ||
|
|
||
| # Command to run FDT | ||
| CMD ["java", "-jar", "fdt.jar", "-p", "54321"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| FROM openjdk:11-jre-slim | ||
|
|
||
| ENV FDT_VERSION=0.26.3 | ||
| ENV FDT_HOME=/fdt | ||
| ENV FDT_JAR=${FDT_HOME}/fdt.jar | ||
|
|
||
| RUN mkdir -p ${FDT_HOME} \ | ||
| && curl -L https://github.com/fast-data-transfer/fdt/releases/download/${FDT_VERSION}/fdt.jar -o ${FDT_JAR} | ||
| # Expose the FDT default port | ||
| EXPOSE 54321 | ||
|
|
||
| WORKDIR ${FDT_HOME} | ||
|
|
||
| # Command to run FDT | ||
| CMD ["java", "-jar", "fdt.jar", "-p", "54321", "-autoport", "-portrange", "100", "-agent"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| for did in `docker images | grep hepgui | awk '{print $3}' | uniq`; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redundant file. delete |
||
| do | ||
| docker image rm $did --force; | ||
| done | ||
| docker build --no-cache -t fdt --platform=linux/amd64 . | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| source ../environment | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redundant file. delete |
||
| docker login | ||
| dockerimageid=`docker images | grep hepgui | grep latest | awk '{print $3}'` | ||
| docker tag $dockerimageid cmscaltech/hepgui:latest | ||
| docker push cmscaltech/hepgui | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might want to replace name. Same name will confuse github actions.