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

Upgrade command #1314

Merged
merged 76 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
48c5f44
dependency conflict check
sunkickr Jun 27, 2023
95095be
add dependency compare
sunkickr Jul 5, 2023
4b5afde
add all tests
sunkickr Jul 18, 2023
4fa29ed
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 18, 2023
dd1b93f
update tests
sunkickr Jul 18, 2023
1a89ab7
Merge remote-tracking branch 'refs/remotes/origin/upgrade-command' in…
sunkickr Jul 18, 2023
662df94
Fixing tests
kushalmalani Jul 19, 2023
80a8f44
Merge branch 'main' into upgrade-command
sunkickr Jul 19, 2023
60d7c2d
fix test
sunkickr Jul 19, 2023
f08d160
fix lint
sunkickr Jul 19, 2023
089ff69
fix lint
sunkickr Jul 19, 2023
52a8b5a
fix lint
sunkickr Jul 19, 2023
24d90d3
fix lint
sunkickr Jul 19, 2023
e3cd499
fix lint
sunkickr Jul 19, 2023
bf2335b
fix lint
sunkickr Jul 19, 2023
c47f36d
empty commit
sunkickr Jul 19, 2023
e0dd966
fix lint
sunkickr Jul 20, 2023
62e738e
fix lint
sunkickr Jul 20, 2023
6a724be
merge with main
sunkickr Jul 20, 2023
994531b
fix lint
sunkickr Jul 20, 2023
e4eaa6c
fix lint
sunkickr Jul 20, 2023
c355247
fix lint
sunkickr Jul 20, 2023
d018712
fix lint
sunkickr Jul 20, 2023
0ea6c72
fix lint
sunkickr Jul 20, 2023
3437ee4
empty commit
sunkickr Jul 20, 2023
d64fff0
fix lint
sunkickr Jul 20, 2023
0d861ad
add tests
sunkickr Jul 20, 2023
43ffc15
move function
sunkickr Jul 20, 2023
64cbd6b
add certified flag
sunkickr Jul 20, 2023
f2d3cf1
add test
sunkickr Jul 24, 2023
cafdbc1
add test
sunkickr Jul 24, 2023
0513f61
add test
sunkickr Jul 24, 2023
b61f385
fix test
sunkickr Jul 24, 2023
e0740a4
fix test
sunkickr Jul 24, 2023
790b2d8
fix test
sunkickr Jul 24, 2023
de95489
fix test
sunkickr Jul 24, 2023
2ea2a57
fix test
sunkickr Jul 24, 2023
dd8471c
fix test
sunkickr Jul 24, 2023
484a594
add test
sunkickr Jul 24, 2023
d470cc3
add test
sunkickr Jul 24, 2023
1622e09
add test
sunkickr Jul 24, 2023
bbad6bb
fix test
sunkickr Jul 24, 2023
7facea3
merge with main
sunkickr Jul 24, 2023
67b80c9
merge with main
sunkickr Jul 24, 2023
4f81ac1
merge with main
sunkickr Jul 24, 2023
a036819
Apply suggestions from code review
sunkickr Jul 25, 2023
c075b01
fix test
sunkickr Jul 25, 2023
a6d5ff8
fix test
sunkickr Jul 25, 2023
9d10ccc
Apply suggestions from code review
sunkickr Jul 25, 2023
bf99af6
update
sunkickr Jul 25, 2023
9445813
merge
sunkickr Jul 25, 2023
fa3620b
update copy
sunkickr Jul 25, 2023
b0d8cc8
update copy
sunkickr Jul 25, 2023
1fa71d9
move to test files
sunkickr Jul 25, 2023
ef86018
Merge branch 'main' into upgrade-command
sunkickr Jul 25, 2023
1e666f8
Apply suggestions from code review
sunkickr Jul 26, 2023
e3c8f18
Update cmd/airflow.go
sunkickr Jul 27, 2023
6114532
Update cmd/airflow.go
sunkickr Jul 27, 2023
356b5c1
Merge branch 'main' into upgrade-command
sunkickr Jul 27, 2023
d69a7b0
fix test
sunkickr Jul 27, 2023
657ae48
add custom image
sunkickr Jul 27, 2023
66e0971
fix command
sunkickr Jul 28, 2023
f6ef793
fix test
sunkickr Jul 31, 2023
1d11262
Merge branch 'main' into upgrade-command
sunkickr Jul 31, 2023
ef864ac
fix dockerfile upgrade
sunkickr Jul 31, 2023
30a137e
Merge remote-tracking branch 'refs/remotes/origin/upgrade-command' in…
sunkickr Jul 31, 2023
c2ad26b
remove init examples
sunkickr Jul 31, 2023
ab1a483
fix command
sunkickr Aug 1, 2023
e3dd3d3
Update airflow/docker_image.go
sunkickr Aug 2, 2023
db37b18
Merge branch 'main' into upgrade-command
sunkickr Aug 2, 2023
b0ad430
merge with main
sunkickr Aug 2, 2023
0e9058c
fix lint
sunkickr Aug 2, 2023
d211764
fix lint
sunkickr Aug 2, 2023
549cbb6
fix lint
sunkickr Aug 2, 2023
bc5ea54
fix lint
sunkickr Aug 2, 2023
4bee3d1
fix lint
sunkickr Aug 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions airflow/airflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ var (
//go:embed include/dockerfile
Dockerfile string

//go:embed include/test-conflicts.dockerfile
testConflitcsDockerfile string
sunkickr marked this conversation as resolved.
Show resolved Hide resolved

//go:embed include/dockerignore
Dockerignore string

Expand Down Expand Up @@ -131,6 +134,18 @@ func Init(path, airflowImageName, airflowImageTag string) error {
return nil
}

func InitUpgradeCheck(path, airflowImageName, airflowImageTag string) error {
sunkickr marked this conversation as resolved.
Show resolved Hide resolved
// Map of files to create
files := map[string]string{
"conflict-check.Dockerfile": fmt.Sprintf(testConflitcsDockerfile, airflowImageName, airflowImageTag),
}
// Initialize files
if err := initFiles(path, files); err != nil {
return errors.Wrap(err, "failed to create upgrade check files")
}
return nil
}

// repositoryName creates an airflow repository name
func repositoryName(name string) string {
return fmt.Sprintf("%s/%s", name, componentName)
Expand Down
11 changes: 8 additions & 3 deletions airflow/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"

"github.com/astronomer/astro-cli/airflow/types"
"github.com/astronomer/astro-cli/astro-client"
"github.com/astronomer/astro-cli/config"
"github.com/astronomer/astro-cli/pkg/fileutil"
"github.com/astronomer/astro-cli/pkg/util"
Expand All @@ -33,6 +34,7 @@ type ContainerHandler interface {
ComposeExport(settingsFile, composeFile string) error
Pytest(pytestFile, customImageName, deployImageName, pytestArgsString string) (string, error)
Parse(customImageName, deployImageName string) error
UpgradeTest(runtimeVersion, deploymentID string, dependencyTest, versionTest, dagTest bool, client astro.Client) error
}

// RegistryHandler defines methods require to handle all operations with registry
Expand All @@ -42,13 +44,16 @@ type RegistryHandler interface {

// ImageHandler defines methods require to handle all operations on/for container images
type ImageHandler interface {
Build(config types.ImageBuildConfig) error
Build(dockerfile string, config types.ImageBuildConfig) error
Push(registry, username, token, remoteImage string) error
GetLabel(labelName string) (string, error)
Pull(registry, username, token, remoteImage string) error
GetLabel(altImageName, labelName string) (string, error)
ListLabels() (map[string]string, error)
TagLocalImage(localImage string) error
Run(dagID, envFile, settingsFile, containerName, dagFile string, taskLogs bool) error
Pytest(pytestFile, airflowHome, envFile string, pytestArgs []string, config types.ImageBuildConfig) (string, error)
Pytest(pytestFile, airflowHome, envFile, testHomeDirectory string, pytestArgs []string, htmlReport bool, config types.ImageBuildConfig) (string, error)
ConflictCheck(workingDirectory, testHomeDirectory string, buildConfig types.ImageBuildConfig) (string, error)
CreatePipFreeze(altImageName, pipFreezeFile string) error
}

type DockerComposeAPI interface {
Expand Down
Loading