-
Notifications
You must be signed in to change notification settings - Fork 7
IE-498: added support to migrate pipelines #5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2105bfc
IE-498: added support to migrate pipelines
skyflow-srivyshnavi 09f4b4a
IE-508: added test cases
skyflow-srivyshnavi dcbf435
IE-515: added workflow, and updated README
skyflow-srivyshnavi 11a7235
IE-498: addressed comments and fixed CI
skyflow-srivyshnavi f0d8ccb
IE-498: updated README
skyflow-srivyshnavi 9ee4646
IE-498: addressed feedback
skyflow-srivyshnavi 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
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,119 @@ | ||
| name: pipelines_migration | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| env_url: | ||
| description: "Select source and target env's" | ||
| type: choice | ||
| default: "Source: SANDBOX, Target: PRODUCTION" | ||
| options: | ||
| - "Source: SANDBOX, Target: PRODUCTION" | ||
| - "Source: SANDBOX, Target: SANDBOX" | ||
| - "Source: PRODUCTION, Target: PRODUCTION" | ||
| - "Source: PRODUCTION, Target: SANDBOX" | ||
| source_datastore_config: | ||
| description: "Source datastore JSON. Provide either an ftpServer or s3Bucket object." | ||
| required: true | ||
| default: | | ||
| { | ||
| "ftpServer": { | ||
| "transferProtocol": "FTPS", | ||
| "plainText": { | ||
| "hostname": "", | ||
| "port": "", | ||
| "username": "", | ||
| "password": "", | ||
| }, | ||
| "skyflowHosted": false | ||
| } | ||
| } | ||
| target_datastore_config: | ||
| description: "Destination datastore JSON. Provide either an ftpServer or s3Bucket object." | ||
| required: true | ||
| default: | | ||
| { | ||
| "s3Bucket": { | ||
| "name": "", | ||
| "region": "", | ||
| "assumedRoleARN": "" | ||
| } | ||
| } | ||
| source_vault_id: | ||
| description: "Source Vault ID." | ||
| required: false | ||
| pipeline_id: | ||
| description: "PipelineID to be migrated." | ||
| required: false | ||
| default: "" | ||
| target_vault_id: | ||
| description: "Target Vault ID" | ||
| required: true | ||
| source_account_access_token: | ||
| description: "Access token of the Source Account. (Not required, if config file is selected)" | ||
| required: false | ||
| target_account_access_token: | ||
| description: "Access token of the Target Account" | ||
| required: true | ||
| source_account_id: | ||
| description: "Source Account ID. If not provided, will use the repository variable" | ||
| required: false | ||
| target_account_id: | ||
| description: "Target Account ID. If not provided, will use the repository variable" | ||
| required: false | ||
|
|
||
|
|
||
| jobs: | ||
| execute-pipelines-migration-script: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install requests | ||
|
|
||
| - name: Parse and map environment URLs | ||
| id: map_envs | ||
| shell: bash | ||
| run: | | ||
| input="${{ github.event.inputs.env_url }}" | ||
| source_name=$(echo "$input" | sed -n 's/Source: \([^,]*\),.*/\1/p' | xargs) | ||
| target_name=$(echo "$input" | sed -n 's/.*Target: \(.*\)/\1/p' | xargs) | ||
| get_env_url() { | ||
| case "$1" in | ||
| SANDBOX) echo "https://manage.skyflowapis-preview.com" ;; | ||
| PRODUCTION) echo "https://manage.skyflowapis.com" ;; | ||
| *) echo "Invalid environment: $1" >&2; exit 1 ;; | ||
| esac | ||
| } | ||
| # Resolve URLs | ||
| source_url=$(get_env_url "$source_name") | ||
| target_url=$(get_env_url "$target_name") | ||
| echo "source_url=$source_url" >> $GITHUB_OUTPUT | ||
| echo "target_url=$target_url" >> $GITHUB_OUTPUT | ||
| - name: Run Python script | ||
| env: | ||
| PIPELINE_ID: ${{ github.event.inputs.pipeline_id }} | ||
| SOURCE_DATASTORE_CONFIG: ${{ github.event.inputs.source_datastore_config }} | ||
| TARGET_DATASTORE_CONFIG: ${{ github.event.inputs.target_datastore_config }} | ||
| SOURCE_VAULT_ID: ${{ github.event.inputs.source_vault_id }} | ||
| TARGET_VAULT_ID: ${{ github.event.inputs.target_vault_id }} | ||
| SOURCE_ACCOUNT_AUTH: ${{ github.event.inputs.source_account_access_token }} | ||
| TARGET_ACCOUNT_AUTH: ${{ github.event.inputs.target_account_access_token }} | ||
| SOURCE_ACCOUNT_ID: ${{ github.event.inputs.source_account_id != '' && github.event.inputs.source_account_id || vars.SOURCE_ACCOUNT_ID }} | ||
| TARGET_ACCOUNT_ID: ${{ github.event.inputs.target_account_id != '' && github.event.inputs.target_account_id || vars.TARGET_ACCOUNT_ID }} | ||
| SOURCE_ENV_URL: ${{ steps.map_envs.outputs.source_url }} | ||
| TARGET_ENV_URL: ${{ steps.map_envs.outputs.target_url }} | ||
| run: python3 migrate_pipelines.py | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.