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

Add support for azure #1043

Merged
merged 12 commits into from
Feb 20, 2024
Merged

Add support for azure #1043

merged 12 commits into from
Feb 20, 2024

Conversation

nickjiang2378
Copy link
Contributor

@nickjiang2378 nickjiang2378 commented Jan 25, 2024

I accidentally committed some large files, so you won't see the commit history because I copied over the changes onto a fresh clone.

@MingweiSamuel
Copy link
Member

For commit names use https://www.conventionalcommits.org/en/v1.0.0/ and for lints run cargo +nightly fmt and cargo clippy --all-targets

@MingweiSamuel
Copy link
Member

For editing and rearrange old commits look into git rebase -i origin/main

};

// #[derive(Debug)]
pub struct LaunchedComputeEngine {
Copy link
Member

Choose a reason for hiding this comment

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

Should probably be renamed to whatever Azure calls this (Compute Engine is a GCP term?). Also commented line above should be removed.


#[async_trait]
impl LaunchedSSHHost for LaunchedComputeEngine {
fn server_config(&self, bind_type: &ServerStrategy) -> ServerBindConfig {
Copy link
Member

Choose a reason for hiding this comment

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

This is nearly identical to GCP, so I wonder if we should move this into the trait and define a separate abstract function for getting the internal_ip.

self.user.as_str()
}

async fn open_ssh_session(&self) -> Result<AsyncSession<TcpStream>> {
Copy link
Member

Choose a reason for hiding this comment

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

Same here, this is identical to GCP so we should share the logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the launchedComputeEngine into a shared file

os_type="linux",
machine_size="Standard_B1s",
region="East US",
image="",
Copy link
Member

Choose a reason for hiding this comment

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

If the image can indeed be omitted, we should make this an optional parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The azure image parameter is a little lengthy, so I made it optional for the user.

https://arc.net/l/quote/moucnywd

deployment = hydro.Deployment()
localhost_machine = deployment.Localhost()

# gcp_vpc = hydro.GCPNetwork(
Copy link
Member

Choose a reason for hiding this comment

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

Leftover code

@MingweiSamuel MingweiSamuel requested a review from shadaj February 15, 2024 00:38
Copy link
Member

@shadaj shadaj left a comment

Choose a reason for hiding this comment

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

Just two tiny nits, otherwise looks great!

fn get_external_ip(&self) -> Option<String> {
self.external_ip.clone()
}
fn get_internal_ip(&self) -> String {
Copy link
Member

Choose a reason for hiding this comment

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

nit: newlines between functions

fn get_external_ip(&self) -> Option<String> {
self.external_ip.clone()
}
fn get_internal_ip(&self) -> String {
Copy link
Member

Choose a reason for hiding this comment

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

nit: newlines between functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@shadaj shadaj left a comment

Choose a reason for hiding this comment

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

Officially multi cloud! 💪

@shadaj shadaj merged commit 348ed10 into hydro-project:main Feb 20, 2024
15 checks passed
MingweiSamuel pushed a commit that referenced this pull request Feb 23, 2024
I accidentally committed some large files, so you won't see the commit
history because I copied over the changes onto a fresh clone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants